diff --git a/IPython/lib/display.py b/IPython/lib/display.py index f65ee41..c50f5fa 100644 --- a/IPython/lib/display.py +++ b/IPython/lib/display.py @@ -255,8 +255,12 @@ class YouTubeVideo(IFrame): """ 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() class VimeoVideo(IFrame): """