hls.js icon indicating copy to clipboard operation
hls.js copied to clipboard

When playing a video in a loop, the video resolution keep changing

Open mirceaulmeanu opened this issue 1 year ago • 3 comments

What version of Hls.js are you using?

1.5.13

What browser (including version) are you using?

Brave (Windows and Android), Chrome (Windows and Android)

What OS (including version) are you using?

Windows and Android

Test stream

No response

Configuration

{
  capLevelOnFPSDrop: true
}

Additional player setup steps

No response

Checklist

  • [X] The issue observed is not already reported by searching on Github under https://github.com/video-dev/hls.js/issues
  • [X] The issue occurs in the stable client (latest release) on https://hlsjs.video-dev.org/demo and not just on my page
  • [X] The issue occurs in the latest client (main branch) on https://hlsjs-dev.video-dev.org/demo and not just on my page
  • [X] The stream has correct Access-Control-Allow-Origin headers (CORS)
  • [X] There are no network errors such as 404s in the browser console when trying to play the stream

Steps to reproduce

  1. Select FDR - CDN packaged, 4s segments, 180p - 1080p from the videos select box in the demo page (any of them)
  2. Set the "loop" attribute on the video to "true" (I wrote this in the console: document.getElementsByTagName("video")[0].loop = true;)
  3. Add a resize event on the video: document.getElementsByTagName("video")[0].addEventListener("resize", (e) => { console.log(e, e.target.videoWidth, e.target.videoHeight) });

Expected behaviour

The video starts at 640 x 360, it adapts to 1920 x 1080 and when it starts over because of loop=true it should start again at 1920 x 1080

What actually happened?

Each iteration the video starts at 640x360 and then jumps at 1920 x 1080

Console output

Not sure what you want here :(

Chrome media internals output

No response

mirceaulmeanu avatar Oct 03 '24 17:10 mirceaulmeanu

A side note, I couldn't reproduce this issue with the first video in the list, the big buck bunny. On my project, the issue reproduces also on Safari iOS, where I am not using hls.js since streaming is natively supported.

mirceaulmeanu avatar Oct 03 '24 17:10 mirceaulmeanu

Duplicates #4553

  • #4553

robwalch avatar Oct 03 '24 19:10 robwalch

Thank you, I haven't found this issue at search. I will try to flush backbuffer. However, I wonder why I can reproduce with the second video and not with the first one.

mirceaulmeanu avatar Oct 04 '24 07:10 mirceaulmeanu