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) - +🙃