iOS - html5 - fullscreen mode - disabling scrubbing

旧时模样 提交于 2019-12-04 19:29:45

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/

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