diff --git a/IPython/lib/display.py b/IPython/lib/display.py index e309398..68f9f3e 100644 --- a/IPython/lib/display.py +++ b/IPython/lib/display.py @@ -8,7 +8,7 @@ from os import walk, sep, fsdecode from IPython.core.display import DisplayObject, TextDisplayObject -from typing import Tuple +from typing import Tuple, Iterable __all__ = ['Audio', 'IFrame', 'YouTubeVideo', 'VimeoVideo', 'ScribdDocument', 'FileLink', 'FileLinks', 'Code'] @@ -263,15 +263,18 @@ class IFrame(object): src="{src}{params}" frameborder="0" allowfullscreen - {extra} + {extras} > """ - def __init__(self, src, width, height, extra="", **kwargs): + def __init__(self, src, width, height, extras: Iterable[str] = None, **kwargs): + if extras is None: + extras = [] + self.src = src self.width = width self.height = height - self.extra = extra + self.extras = extras self.params = kwargs def _repr_html_(self): @@ -286,7 +289,7 @@ class IFrame(object): width=self.width, height=self.height, params=params, - extra=self.extra, + extras=" ".join(self.extras), ) @@ -320,7 +323,7 @@ class YouTubeVideo(IFrame): self.id=id src = "https://www.youtube.com/embed/{0}".format(id) if allow_autoplay: - kwargs.update(autoplay=1, extra='allow="autoplay"') + kwargs.update(autoplay=1, extras=['allow="autoplay"']) super(YouTubeVideo, self).__init__(src, width, height, **kwargs) def _repr_jpeg_(self):