Skip to content

Commit ca4af65

Browse files
authored
Merge pull request #13236 from meeseeksmachine/auto-backport-of-pr-13235-on-7.x
Backport PR #13235 on branch 7.x (Update what's of of older IPython (forgotten))
2 parents 2bdf14c + 8775ab7 commit ca4af65

File tree

3 files changed

+53
-45
lines changed

3 files changed

+53
-45
lines changed

docs/source/whatsnew/pr/enable-to-add-extra-attrs-to-iframe.rst

Lines changed: 0 additions & 38 deletions
This file was deleted.

docs/source/whatsnew/pr/pastebin-expiry-days.rst

Lines changed: 0 additions & 7 deletions
This file was deleted.

docs/source/whatsnew/version7.rst

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,49 @@ New Features:
8080
- Reword the YouTubeVideo autoplay WN :ghpull:`13147`
8181

8282

83+
Highlighted features
84+
--------------------
85+
86+
87+
``YouTubeVideo`` autoplay and the ability to add extra attributes to ``IFrame``
88+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
89+
90+
You can add any extra attributes to the ``<iframe>`` tag using the new
91+
``extras`` argument in the ``IFrame`` class. For example::
92+
93+
In [1]: from IPython.display import IFrame
94+
95+
In [2]: IFrame(src="src", width=300, height=300, extras=['loading="eager"'])
96+
97+
The above cells will result in the following HTML code being displayed in a
98+
notebook::
99+
100+
<iframe
101+
width="300"
102+
height="300"
103+
src="src"
104+
frameborder="0"
105+
allowfullscreen
106+
loading="eager"
107+
></iframe>
108+
109+
Related to the above, the ``YouTubeVideo`` class now takes an
110+
``allow_autoplay`` flag, which sets up the iframe of the embedded YouTube video
111+
such that it allows autoplay.
112+
113+
.. note::
114+
Whether this works depends on the autoplay policy of the browser rendering
115+
the HTML allowing it. It also could get blocked by some browser extensions.
116+
117+
Try it out!
118+
::
119+
120+
In [1]: from IPython.display import YouTubeVideo
121+
122+
In [2]: YouTubeVideo("dQw4w9WgXcQ", allow_autoplay=True)
123+
124+
125+
83126
Thanks
84127
------
85128

@@ -137,6 +180,16 @@ Of particular interest are the following Pull-requests:
137180
:ghpull:`13056`
138181
- Make Ipython.utils.timing work with jupyterlite :ghpull:`13050`.
139182

183+
Pastebin magic expiry days option
184+
---------------------------------
185+
186+
The Pastebin magic now has ``-e`` option to determine
187+
the number of days for paste expiration. For example
188+
the paste that created with ``%pastebin -e 20 1`` magic will
189+
be available for next 20 days.
190+
191+
192+
140193

141194

142195
Thanks

0 commit comments

Comments
 (0)