videojs / video.js

Video.js - open source HTML5 video player
https://videojs.com
Other
37.51k stars 7.4k forks source link

DVR live stream seek to live edge malfunctionning #7554

Open amtins opened 2 years ago

amtins commented 2 years ago

Description

dvr-live-stream

Steps to reproduce

  1. Open videojs-http-streaming.netlify.app
  2. Start the playback
  3. Seek backward approximately 1 minute, the value doesn't matter
  4. Let the playback run for 5 minutes
  5. Try to seek to the live edge

Results

Expected

Seeking to the live edge should not leave a space in the progress bar.

Actual

Seeking to the live edge leaves a space in the progress bar.

Error output

VIDEOJS: WARN: Problem encountered with playlist 0-https://d2zihajmogu5jn.cloudfront.net/pdt-test-source/no-endlist.m3u8. Trying again since it is the only playlist.

Additional Information

versions

videojs

Version 7.17.1 but older versions are also affected

browsers

Firefox, Chrome

OSes

Ubuntu

video-archivist-bot commented 2 years ago

Hey! We've detected some video files in a comment on this issue. If you'd like to permanently archive these videos and tie them to this project, a maintainer of the project can reply to this issue with the following commands:

gkatsev commented 2 years ago

I'm unable to reproduce. It's also worth noting that that that source isn't actually live and so it will eventually time out for playback since no new segments are generated and being delivered. Do you have issues with the button on other live streams?

LuoyeAn commented 2 years ago

Description

dvr-live-stream

Steps to reproduce

  1. Open videojs-http-streaming.netlify.app
  2. Start the playback
  3. Seek backward approximately 1 minute, the value doesn't matter
  4. Let the playback run for 5 minutes
  5. Try to seek to the live edge

Results

Expected

Seeking to the live edge should not leave a space in the progress bar.

Actual

Seeking to the live edge leaves a space in the progress bar.

Error output

VIDEOJS: WARN: Problem encountered with playlist 0-https://d2zihajmogu5jn.cloudfront.net/pdt-test-source/no-endlist.m3u8. Trying again since it is the only playlist.

Additional Information

versions

videojs

Version 7.17.1 but older versions are also affected

browsers

Firefox, Chrome

OSes

Ubuntu

I have the same problem with Version 7.17.1. After downgrading to version 7.14.3, it works well. 😀

video-archivist-bot commented 2 years ago

Hey! We've detected some video files in a comment on this issue. If you'd like to permanently archive these videos and tie them to this project, a maintainer of the project can reply to this issue with the following commands:

evd1ser commented 2 years ago

same problem =(

amtins commented 2 years ago

@gkatsev thank you for taking the time to look. We noticed the problem first in our live streams.

Do you have issues with the button on other live streams?

The issue with the button or the use of the scrubber is a consequence of another problem. In a (true) live stream with DVR what I noticed is

player.liveTracker.seekableEnd() - player.liveTracker.seekableStart() // equals to the live window
player.liveTracker.liveWindow() // the live window expands indefinitely

see https://github.com/videojs/video.js/blob/3c213455ee02ad8d8e68ae593e96d7113fdf3272/src/js/live-tracker.js#L301-L310 Here https://github.com/videojs/video.js/blob/3c213455ee02ad8d8e68ae593e96d7113fdf3272/src/js/control-bar/progress-control/seek-bar.js#L231

The value of liveTracker.seekableStart() is always equals to 0, maybe it could explain something.

amtins commented 2 years ago

In addition, on our side we manage to do a quick fix

    const currentTime = this.getCurrentTime_();//eslint-disable-line
    let percent;
    const { liveTracker } = this.player();

    if (liveTracker && liveTracker.isLive()) {
      const seekableStart = liveTracker.seekableStart();
      const seekableEnd = liveTracker.seekableEnd();
      const liveWindow = seekableEnd - seekableStart;

      percent = (currentTime - seekableStart) / liveWindow;
// ...
gkatsev commented 2 years ago

in a live DVR, seekable start should be 0. One thing we noticed is that in a recent version of our playback engine, we broke the code that updates the seekable internally properly. You may want to downgrade to video.js 7.15 until we fix this issue, which we're actively investigating.

gkatsev commented 2 years ago

Just released the fix in 7.17.3. Early next week, we'll promote this release to latest.

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.