From ad5917894668534b4fd1c4f629967ec7d244d684 2021-09-21 23:06:44 From: Blazej Michalik <6691643+MrMino@users.noreply.github.com> Date: 2021-09-21 23:06:44 Subject: [PATCH] Merge pull request #13148 from meeseeksmachine/auto-backport-of-pr-13147-on-7.x Backport PR #13147 on branch 7.x (Reword the YouTubeVideo autoplay WN) --- diff --git a/docs/source/whatsnew/pr/enable-to-add-extra-attrs-to-iframe.rst b/docs/source/whatsnew/pr/enable-to-add-extra-attrs-to-iframe.rst index f4f3ad5..1954bc4 100644 --- a/docs/source/whatsnew/pr/enable-to-add-extra-attrs-to-iframe.rst +++ b/docs/source/whatsnew/pr/enable-to-add-extra-attrs-to-iframe.rst @@ -1,37 +1,38 @@ -Enable to add extra attributes to iframe -======================================== +``YouTubeVideo`` autoplay and the ability to add extra attributes to ``IFrame`` +=============================================================================== -You can add any extra attributes to the `` +The above cells will result in the following HTML code being displayed in a +notebook:: -Using it, you can autoplay ``YouTubeVideo`` by adding ``'allow="autoplay"'``, -even in browsers that disable it by default, such as Google Chrome. -And, you can write it more briefly by using the argument ``allow_autoplay``. + + +Related to the above, the ``YouTubeVideo`` class now takes an +``allow_autoplay`` flag, which sets up the iframe of the embedded YouTube video +such that it allows autoplay. + +.. note:: + Whether this works depends on the autoplay policy of the browser rendering + the HTML allowing it. It also could get blocked by some browser extensions. + +Try it out! :: In [1]: from IPython.display import YouTubeVideo - In [2]: print(YouTubeVideo("video-id", allow_autoplay=True)._repr_html_()) + In [2]: YouTubeVideo("dQw4w9WgXcQ", allow_autoplay=True) - +🙃