Seeking in HTML5 video with Chrome

前端 未结 6 1110
南旧
南旧 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条回答
  •  既然无缘
    2020-12-08 11:17

    You have 3 possibilities for the Video tag: MP4, OGG, WebM.

    Not all formats work in all browsers.

    Here, I'm thinking that WebM works in Firefox but not Chrome, so you should supply both alternative formats for MP4 and WebM files, by including a 2nd Source tag referring to the MP4 file.

    E.g. src="data/video1.mp4" type="video/mp4"

    The relevant version will be automatically selected by the browser.

提交回复
热议问题