Video Output Types¶
This module defines the rich output types for video formats.
- class sage.repl.rich_output.output_video.OutputVideoAvi(video, loop=True)¶
Bases:
sage.repl.rich_output.output_video.OutputVideoBaseAVI video
EXAMPLES:
sage: from sage.repl.rich_output.output_catalog import OutputVideoAvi sage: OutputVideoAvi.example() OutputVideoAvi container
- class sage.repl.rich_output.output_video.OutputVideoBase(video, loop=True)¶
Bases:
sage.repl.rich_output.output_basic.OutputBaseAbstract base class for rich video output
INPUT:
video–OutputBuffer. The video data.loop– boolean. Whether to repeat the video in an endless loop.
EXAMPLES:
sage: from sage.repl.rich_output.output_catalog import OutputVideoOgg sage: OutputVideoOgg.example() # indirect doctest OutputVideoOgg container
- classmethod example()¶
Construct a sample video output container
This static method is meant for doctests, so they can easily construct an example. The method is implemented in the abstract
OutputVideoBaseclass, but should get invoked on a concrete subclass for which an actual example can exist.OUTPUT:
An instance of the class on which this method is called.
EXAMPLES:
sage: from sage.repl.rich_output.output_catalog import OutputVideoOgg sage: OutputVideoOgg.example() OutputVideoOgg container sage: OutputVideoOgg.example().video buffer containing 5612 bytes sage: OutputVideoOgg.example().ext '.ogv' sage: OutputVideoOgg.example().mimetype 'video/ogg'
- html_fragment(url, link_attrs='')¶
Construct a HTML fragment for embedding this video
INPUT:
url– string. The URL where the data of this video can be found.link_attrs– string. Can be used to style the fallback link which is presented to the user if the video is not supported.
EXAMPLES:
sage: from sage.repl.rich_output.output_catalog import OutputVideoOgg sage: print(OutputVideoOgg.example().html_fragment ....: ('foo', 'class="bar"').replace('><','>\n<')) <video autoplay="autoplay" controls="controls" loop="loop"> <source src="foo" type="video/ogg" /> <p> <a target="_new" href="foo" class="bar">Download video/ogg video</a> </p> </video>
- class sage.repl.rich_output.output_video.OutputVideoFlash(video, loop=True)¶
Bases:
sage.repl.rich_output.output_video.OutputVideoBaseFlash video
EXAMPLES:
sage: from sage.repl.rich_output.output_catalog import OutputVideoFlash sage: OutputVideoFlash.example() OutputVideoFlash container
- class sage.repl.rich_output.output_video.OutputVideoMatroska(video, loop=True)¶
Bases:
sage.repl.rich_output.output_video.OutputVideoBaseMatroska Video
EXAMPLES:
sage: from sage.repl.rich_output.output_catalog import OutputVideoMatroska sage: OutputVideoMatroska.example() OutputVideoMatroska container
- class sage.repl.rich_output.output_video.OutputVideoMp4(video, loop=True)¶
Bases:
sage.repl.rich_output.output_video.OutputVideoBaseMPEG 4 video
EXAMPLES:
sage: from sage.repl.rich_output.output_catalog import OutputVideoMp4 sage: OutputVideoMp4.example() OutputVideoMp4 container
- class sage.repl.rich_output.output_video.OutputVideoOgg(video, loop=True)¶
Bases:
sage.repl.rich_output.output_video.OutputVideoBaseOgg video, Ogg Theora in particular
EXAMPLES:
sage: from sage.repl.rich_output.output_catalog import OutputVideoOgg sage: OutputVideoOgg.example() OutputVideoOgg container
- class sage.repl.rich_output.output_video.OutputVideoQuicktime(video, loop=True)¶
Bases:
sage.repl.rich_output.output_video.OutputVideoBaseQuicktime video
EXAMPLES:
sage: from sage.repl.rich_output.output_catalog import OutputVideoQuicktime sage: OutputVideoQuicktime.example() OutputVideoQuicktime container
- class sage.repl.rich_output.output_video.OutputVideoWebM(video, loop=True)¶
Bases:
sage.repl.rich_output.output_video.OutputVideoBaseWebM video
The video can be encoded using VP8, VP9 or an even more recent codec.
EXAMPLES:
sage: from sage.repl.rich_output.output_catalog import OutputVideoWebM sage: OutputVideoWebM.example() OutputVideoWebM container
- class sage.repl.rich_output.output_video.OutputVideoWmv(video, loop=True)¶
Bases:
sage.repl.rich_output.output_video.OutputVideoBaseWindows Media Video
EXAMPLES:
sage: from sage.repl.rich_output.output_catalog import OutputVideoWmv sage: OutputVideoWmv.example() OutputVideoWmv container