HTML5 video seeking on iPad

前端 未结 4 732
小蘑菇
小蘑菇 2021-02-05 08:19

I have an HTML5 video player with a custom seek bar, that\'s working great on the iPhone (playing inline) and on the browser.

It plays great on the iPad too and the seek

4条回答
  •  不知归路
    2021-02-05 08:25

    This issue is related with value used on the video.currentTime property. On my specific case I fixed the problem by always making sure I was using floating point numbers with 1 decimal digit during the seek.

    Setting video.currentTime to ZERO on iOS 3.2 will indeed seek the video to the beginning but the value won't update after that - timeupdate event is still dispatched normally but if you try to read currentTime it will always return the same value.

    To seek to the begin of the video use 0.1 instead of 0, to seek to 12.2345 use 12.2.

    PS: you can use (+(12.2345).toFixed(1)) to limit the number of decimal digits to 1.

提交回复
热议问题