From 2247f3474cc92ffc18b84a4d326be30aa9f55275 2015-12-21 10:53:08 From: Ben Kasel Date: 2015-12-21 10:53:08 Subject: [PATCH] - changed to default jpeg image for YouTubeVideo representation - added blank line - added small note to the docstring --- diff --git a/IPython/lib/display.py b/IPython/lib/display.py index c50f5fa..e46e254 100644 --- a/IPython/lib/display.py +++ b/IPython/lib/display.py @@ -252,15 +252,19 @@ class YouTubeVideo(IFrame): Other parameters can be provided as documented at https://developers.google.com/youtube/player_parameters#parameter-subheader + + When converting the notebook using nbconvert, a jpeg representation of the video + will be inserted in the document. """ def __init__(self, id, width=400, height=300, **kwargs): self.id=id src = "https://www.youtube.com/embed/{0}".format(id) super(YouTubeVideo, self).__init__(src, width, height, **kwargs) + def _repr_jpeg_(self): from urllib import urlopen - return urlopen("https://img.youtube.com/vi/{id}/0.jpg".format(id=self.id)).read() + return urlopen("https://img.youtube.com/vi/{id}/default.jpg".format(id=self.id)).read() class VimeoVideo(IFrame): """