Seeking in HTML5 video with Chrome

前端 未结 6 1118
南旧
南旧 2020-12-08 10:48

I\'m having issues seeking in video\'s using Chrome.

For some reason, no matter what I do, video.seekable.end(0) is always 0.

When I call

6条回答
  •  猫巷女王i
    2020-12-08 11:16

    I had a similar problem. I was listening for an the end event on a video and setting currentTime to the middle of the video to loop it continuously. It wasn't working in Safari or Chrome.

    I think there may be a bug in Safari/Chrome where playhead position properties aren't available unless the media is currently playing.

    My workaround was to start my loop just before the video end and not letting it actually end.

    Try testing yours by starting playback first and then run your fuction to see if it works in Safari Chrome.

提交回复
热议问题