videojs / video.js

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

Preserve quality upon looping #7693

Open fcisio opened 2 years ago

fcisio commented 2 years ago

Description

Hi, I was previously using HLS.js but this lib doesn't seem to work with mobile for me.

While implementing HLS I had an issue where each time a video would loop, the quality that was loaded would be lost. It would basically be an endless cycle of bad to good quality.

I found this workaround which worked perfectly.

Now I want to replicate the workaround with videojs, but I don't know if it's possible.

Steps to reproduce

  1. Set any video (m3u8) to loop
  2. Look at the quality going from bad to good on each loop

Results

Expected

The quality should be preserved upon looping.

Actual

The quality is lost upon looping.

Error output

None

versions

videojs

latest

browsers

all

OSes

all

gkatsev commented 2 years ago

How are you looping? Also, in a quick test, it seems to preserve the selected rendition. I used https://videojs-http-streaming.netlify.app/?debug=false&autoplay=false&muted=false&fluid=true&minified=false&sync-workers=false&liveui=true&llhls=false&url=https%3A%2F%2Fd2zihajmogu5jn.cloudfront.net%2Fbipbop-advanced%2Fbipbop_16x9_variant.m3u8&type=application%2Fx-mpegurl&keysystems=&buffer-water=false&exact-manifest-timings=false&pixel-diff-selector=false&network-info=false&dts-offset=false&override-native=true&preload=auto&mirror-source=true

You can then set loop via player.loop(true) in the console, and then if you wait for it to change to say gear 5, (the highest rendition), you can seek towards the end and when it loops, it stays on gear 5 for me.

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:

fcisio commented 2 years ago

Hey @gkatsev I think you're right. On desktop, it seems to preserve the quality/rendition.

My issue is then probably related to mobile devices. I guess this is probably due to some mobile browsers using native HLS, so bypassing videojs.

Do you know about quality/performance optimization possibilities regarding native HLS & videojs?

Thanks.

gkatsev commented 2 years ago

There isn't a way to control renditions when native HLS is played.