video-dev / hls.js

HLS.js is a JavaScript library that plays HLS in browsers with support for MSE.
https://hlsjs.video-dev.org/demo
Other
14.8k stars 2.57k forks source link

BaseStreamController always honor config.startPosition when attaching(recovering) #6297

Closed kedanielwu closed 2 weeks ago

kedanielwu commented 7 months ago

What do you want to do with Hls.js?

In BaseStreamController, onMediaAttached callback always use config.startPosition to call startLoad(), regardless the playback status. Is this behaviour desired? I found it bit weried.

lets say I set startPosition to 90, and played for a while, then call the recoverMediaError() call will seek back to 90, shouldn't BaseStreamController.lastCurrentTime be used in this case?

What have you tried so far?

No response

robwalch commented 7 months ago

Using config.startPosition on attached is a "feature". While you need to clear or change the value before re-attaching the player, I can agree that this should not be the behavior when using recoverMediaError().

robwalch commented 2 months ago

6591 fixes this behavior for recoverMediaError().

You can try the branch build at https://feature-interstitials.hls-js-4zn.pages.dev/demo/