Webkit-playsinline on iphone

后端 未结 2 1618
长情又很酷
长情又很酷 2021-01-15 08:39

I\'m currently working on a project with a lot of videos and this project needs to work on iphone.

But actually, the ios\'s video placeholder doesn\'t allows me to s

2条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-15 09:07

    I've been looking into this issue extensively as well.

    Unfortunately, 'webkit-playsinline' only works in a UIWebView in a native app, and then only when a flag is set in the native code. See this question.

    From Apple's docs it seems there is no way to prevent this default behavior, but you can still capture the 'ended' and 'paused' events from the native player as if it were simply an HTML5 player inline in the page. I.e. event listeners on 'ended' etc. should still work.

    You can also get some state information from the native player: https://developer.apple.com/library/safari/documentation/AudioVideo/Reference/HTMLVideoElementClassReference/HTMLVideoElement/HTMLVideoElement.html

    Overall, you can only interact with the native player in a very limited way, and no known overrides exist.

提交回复
热议问题