Suppress autoplay on Google ytplayer

69 Views Asked by At

I have a page with an embedded youtube video. The playerVar autoplay is set to 0. But when the page loads, the iframe delivered by the API is

<iframe id="ytplayer" frameborder="0" allowfullscreen="1" allow="autoplay;    encrypted-media" title="YouTube video player" width="533" height="400" src="https://www.youtube.com/embed/myVideo?autoplay=0&amp;controls=1&amp;fs=0&amp;origin=https%3A%2F%2Fexample.com&amp;showInfo=0&amp;rel=0&amp;enablejsapi=1&amp;widgetid=1"></iframe>

Note "allow="autoplay; Why does this happen?? Furthermore, the video autoplays on some browsers/systems and not on others.

1

There are 1 best solutions below

1
On

Well you could try to remove autoplay; from the allow attribute ;)

<iframe id="ytplayer" frameborder="0" allowfullscreen="1" allow="encrypted-media" title="YouTube video player" width="533" height="400" src="https://www.youtube.com/embed/myVideo?autoplay=0&amp;controls=1&amp;fs=0&amp;origin=https%3A%2F%2Fexample.com&amp;showInfo=0&amp;rel=0&amp;enablejsapi=1&amp;widgetid=1"></iframe