Dailymotion embedded player on iOS devices (HTML5)

╄→尐↘猪︶ㄣ 提交于 2019-11-28 14:38:55

Your code is perfectly valid. The thing is that most mobile devices, including iOS devices, prevent videos from being played automatically (see Apple documentation : Safari HTML5 Audio and Video Guide). On those devices, the first play must be triggered by a user interaction, such as touching the play button, otherwise it's ignored by the browser.

The apiready event is triggered by the Dailymotion SDK and is not a user event. That's why the play() method as no effect on the video.

[Edit]: You'd rather call the play() method from another event listener, such as a click or touchend event.. Also, as the Dailymotion Player is embedded within an <iframe>, the communication between the parent page and the <iframe> will always be considered as a programmatic event by the browser, no matter if the original event from the parent page comes from a user or not.

TLDR: On mobile device, you must wait for the user to touch the player's start screen.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!