HTML5 video player behavior on iPhone and iPod in Safari Web Apps

后端 未结 2 1495
执笔经年
执笔经年 2020-12-02 12:28

On the iPhone and iPod, if a YouTube video is embedded in a web page, the user can touch the video and the video will start playing—the iOS media player slides in and the vi

2条回答
  •  时光取名叫无心
    2020-12-02 13:27

    From the Safari documentation:

    "Important: The webkitEnterFullscreen() method can be invoked only in response to a user action, such as clicking a button. You cannot invoke webkitEnterFullscreen() in response to an onload() event, for example."

    That might explain why your webkitEnterFullscreen is always false.

    http://developer.apple.com/library/safari/documentation/AudioVideo/Conceptual/Using_HTML5_Audio_Video/ControllingMediaWithJavaScript/ControllingMediaWithJavaScript.html#//apple_ref/doc/uid/TP40009523-CH3-SW13

    Jan's solution handling the 'ended' event is the best in your case.

提交回复
热议问题