HTML5 Video Tag in Chrome - Why is currentTime ignored when video downloaded from my webserver?

后端 未结 1 1264
旧巷少年郎
旧巷少年郎 2021-02-01 10:01

I want to be able to play back video from a specific time using the HTML5 video tag (and currently only need to worry about Chrome). This is possible by setting the currentTime

1条回答
  •  囚心锁ツ
    2021-02-01 10:36

    Make sure your web server is capable of serving the document using byte ranges. Google Chrome requires that this works. Without it, seeking will be disabled and setting currentTime will have no effect.

    To test if your web server does this, use the following command:

    curl --dump-header - -r0-0 http://theurl
    

    The response status must read 206 Partial Content and you should receive only the first byte of the resource instead of the whole resource.

    -Phil

    0 讨论(0)
提交回复
热议问题