You are viewing an older version (9.10.0). Go to latest (9.13.0)
{ } Raw JSON

bundles / IPython 9.10.0 / IPython / lib / display / YouTubeVideo

class

IPython.lib.display:YouTubeVideo

source: /IPython/lib/display.py :304

Signature

class   YouTubeVideo ( id width = 400 height = 300 allow_autoplay = False ** kwargs )

Members

Summary

Class for embedding a YouTube Video in an IPython session, based on its video id.

Extended Summary

e.g. to embed the video from https://www.youtube.com/watch?v=foo , you would do

vid = YouTubeVideo("foo")
display(vid)

To start from 30 seconds

vid = YouTubeVideo("abc", start=30)
display(vid)

To calculate seconds from time as hours, minutes, seconds use datetime.timedelta:

start=int(timedelta(hours=1, minutes=46, seconds=40).total_seconds())

Other parameters can be provided as documented at https://developers.google.com/youtube/player_parameters#Parameters

When converting the notebook using nbconvert, a jpeg representation of the video will be inserted in the document.

Aliases

  • IPython.display.YouTubeVideo