YouTube API not working in iOS (iPhone/iPad) but working fine in Desktop browsers?

后端 未结 1 776
忘掉有多难
忘掉有多难 2021-01-02 21:46

I am using the YouTube API in a simple one page website. I am able to get videos to play and all of my YouTube functionality works successfully in Desktop browsers (with the

相关标签:
1条回答
  • 2021-01-02 21:48

    According to this other SO post, limitations exist on iOS, where "...embedded media cannot be played automatically programatically in Safari on iOS - the user always initiates playback."

    I had the same problem and it turns out you can have a YouTube-API IFrame properly embedded and shown on iOS with YouTube's big red "Play" button, it's just that iOS won't let you start/stop the video with your own controls & JavaScript. E.g. you can next/previous with JavaScript, but you cannot play/pause, which has to be done by clicking on the video, then with the native controls next to the video progress bar.

    But regarding the last sentence of your first paragraph and putting aside these limitations, the YouTube player should show, there is something wrong in what you did (though I'm not expert enough to tell what). I am also doing that in a simple one-page website, feel free to have a look at what I did.

    Hope that helps!

    0 讨论(0)
提交回复
热议问题