开发者

iOS - html5 - fullscreen mode - disabling scrubbing

I have a ht开发者_Python百科ml5 videoplayer with custom controls that I show/hide as needed. The default controls are removed via video.removeAttribute("controls").

However, when the user launches fullscreen, he gets the default iOS controls and can scrub through ads.

Is there a way of disabling seeking in fullscreen mode?

Thanks.


According to Apple, in fullscreen mode, they will always provide video controls:

http://developer.apple.com/library/safari/#documentation/AudioVideo/Conceptual/Using_HTML5_Audio_Video/Device-SpecificConsiderations/Device-SpecificConsiderations.html

You could always disable fullscreen on iPad for the ad (removing the fullscreen control), then move back to fullscreen for the content. Not optimal, and won't work on iPhone/iPod Touch.


There is no way to directly prevent user from scrubbing in full screen mode in iOS, but there is a workaround which roughly work as below

  1. keep tracking of the playhead by subscribing timeupdate event
  2. subscribe seeked event, which will be fired when user scrubbing ends
  3. when receive seeked event, change videoEl.currenttime to last known playhead

To make it really work, there are some more details you need to work out. For example, when you change the currenttime, it will also trigger a seeked event. Therefore the step 3 should distinguish between seeked triggered by user scrubbing or yourself.

As of July 2016, the IMA3 SDK implemented something similar. You can try their demo at http://googleads.github.io/googleads-ima-html5/simple/

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜