IPython 8.4.0 Pypi GitHub Homepage
Other Docs
ParametersBackRef
__init__(self, data=None, url=None, filename=None, embed=False, mimetype=None, width=None, height=None, html_attributes='controls')

When this object is returned by an input cell or passed to the display function, it will result in the video being displayed in the frontend.

Parameters

data : unicode, str or bytes

The raw video data or a URL or filename to load the data from. Raw data will require passing embed=True .

url : unicode

A URL for the video. If you specify url= , the image data will not be embedded.

filename : unicode

Path to a local file containing the video. Will be interpreted as a local URL unless embed=True .

embed : bool

Should the video be embedded using a data URI (True) or be loaded using a <video> tag (False).

Since videos are large, embedding them should be avoided, if possible. You must confirm embedding as your intention by passing embed=True .

Local files can be displayed with URLs without embedding the content, via:

Video('./video.mp4')
mimetype : unicode

Specify the mimetype for embedded videos. Default will be guessed from file extension, if available.

width : int

Width in pixels to which to constrain the video in HTML. If not supplied, defaults to the width of the video.

height : int

Height in pixels to which to constrain the video in html. If not supplied, defaults to the height of the video.

html_attributes : str

Attributes for the HTML <video> block. Default: "controls" to get video controls. Other examples: "controls muted" for muted video with controls, "loop autoplay" for looping autoplaying video without controls.

Create a video object given raw data or an URL.

Examples

Video('https://archive.org/download/Sita_Sings_the_Blues/Sita_Sings_the_Blues_small.mp4') Video('path/to/video.mp4') Video('path/to/video.mp4', embed=True) Video('path/to/video.mp4', embed=True, html_attributes="controls muted autoplay") Video(b'raw-videodata', embed=True)

See :

Back References

The following pages refer to to this document either explicitly or contain code examples using this.

papyri

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


GitHub : /IPython/core/display.py#1072
type: <class 'function'>
Commit: