Show More
@@ -8,7 +8,7 b' from os import walk, sep, fsdecode' | |||
|
8 | 8 | |
|
9 | 9 | from IPython.core.display import DisplayObject, TextDisplayObject |
|
10 | 10 | |
|
11 | from typing import Tuple | |
|
11 | from typing import Tuple, Iterable | |
|
12 | 12 | |
|
13 | 13 | __all__ = ['Audio', 'IFrame', 'YouTubeVideo', 'VimeoVideo', 'ScribdDocument', |
|
14 | 14 | 'FileLink', 'FileLinks', 'Code'] |
@@ -263,15 +263,18 b' class IFrame(object):' | |||
|
263 | 263 | src="{src}{params}" |
|
264 | 264 | frameborder="0" |
|
265 | 265 | allowfullscreen |
|
266 | {extra} | |
|
266 | {extras} | |
|
267 | 267 | ></iframe> |
|
268 | 268 | """ |
|
269 | 269 | |
|
270 |
def __init__(self, src, width, height, extra= |
|
|
270 | def __init__(self, src, width, height, extras: Iterable[str] = None, **kwargs): | |
|
271 | if extras is None: | |
|
272 | extras = [] | |
|
273 | ||
|
271 | 274 | self.src = src |
|
272 | 275 | self.width = width |
|
273 | 276 | self.height = height |
|
274 | self.extra = extra | |
|
277 | self.extras = extras | |
|
275 | 278 | self.params = kwargs |
|
276 | 279 | |
|
277 | 280 | def _repr_html_(self): |
@@ -286,7 +289,7 b' class IFrame(object):' | |||
|
286 | 289 | width=self.width, |
|
287 | 290 | height=self.height, |
|
288 | 291 | params=params, |
|
289 | extra=self.extra, | |
|
292 | extras=" ".join(self.extras), | |
|
290 | 293 | ) |
|
291 | 294 | |
|
292 | 295 | |
@@ -320,7 +323,7 b' class YouTubeVideo(IFrame):' | |||
|
320 | 323 | self.id=id |
|
321 | 324 | src = "https://www.youtube.com/embed/{0}".format(id) |
|
322 | 325 | if allow_autoplay: |
|
323 | kwargs.update(autoplay=1, extra='allow="autoplay"') | |
|
326 | kwargs.update(autoplay=1, extras=['allow="autoplay"']) | |
|
324 | 327 | super(YouTubeVideo, self).__init__(src, width, height, **kwargs) |
|
325 | 328 | |
|
326 | 329 | def _repr_jpeg_(self): |
General Comments 0
You need to be logged in to leave comments.
Login now