Video.js: Start HLS live stream at first segment

Created on 12 Feb 2019  路  3Comments  路  Source: videojs/video.js

Hello,

First thanks for your hard work the player is really useful !

I'm using the brand new seekbar and trying to start an HLS live stream at the first segment but currentTime() doesn't seem to work even with negative integers.

  componentDidMount() {
    // instantiate Video.js
    this.player = videojs(this.videoNode, this.props, function onPlayerReady() {
      this.player_.currentTime(0)
    });
  }

I'm probably doing something wrong, thanks a lot !

Most helpful comment

Thanks a lot, it works as intended !

All 3 comments

馃憢 Thanks for opening your first issue here! 馃憢

If you're reporting a 馃悶 bug, please make sure you include steps to reproduce it. We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can.
To help make it easier for us to investigate your issue, please follow the contributing guidelines.

Seeking on loadedmetadata is probably more reliable and safer. Additionally, you probably should be seeking to the beginning of the seekable range rather than 0. Something like:
```js
player.on('loadedmetadata', function() {
player.currentTime(player.seekable().start(0));
});

Thanks a lot, it works as intended !

Was this page helpful?
0 / 5 - 0 ratings

Related issues

victorpfm picture victorpfm  路  4Comments

jeonghwaYoo picture jeonghwaYoo  路  3Comments

borm picture borm  路  3Comments

pblasi picture pblasi  路  3Comments

d3x7r0 picture d3x7r0  路  4Comments