">?autoplay=1" frameborder="0" al...">

Ios 10 youtube iframe not playing

I am using the following iframe in my HTML code:

        <iframe src="<iframeurl>">?autoplay=1" frameborder="0" allowfullscreen></iframe>

      

On iPhones with iOS10, this is not autoplay. I get a red play button and stuff. On windows chrome and others everything works fine, autoplay starts correctly. But not with the iphone.

Can I do anything in javascript or manipulate the url to make this autoplay? I know that Apple used to disallow autoplay before iOS10, so maybe I'm doing something wrong here.

+3


source to share


4 answers


Just add a play trigger to onClick and then call the click event from the AJAX response.



Must do the trick;)

+3


source


You're experiencing this because Apple doesn't allow built-in media games to play automatically - the user always starts playing.



This is mentioned in the YouTube IFrame Player API Documentation . And no, I don't think you can and should override this as it is bad practice.

+4


source


It's not that iOS prevents any video from automatically playing (at least not like it did in iOS 10), but rather that silent video doesn't play without user interaction. So if you embed a YouTube video appended muted=1

to the url, autoplay will work again.

The postscript parameter is muted

not documented for built-in YouTube players. It's not in the official doc: https://developers.google.com/youtube/player_parameters . And yet this has been working for quite some time. If you are concerned that one day this might not work, you can take a programmatic approach using the iframe API: first mute the video, then play it when the event is generated ready

.

0


source


putting this in config.xml worked for me <allow-navigation href="*://*youtube.com"/>

0


source







All Articles