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.83k stars 2.57k forks source link

.ts file expired in response to 403, Hls.ErrorTypes.NETWORK_ERROR loadSource The new .m3u8 will load the .ts file from scratch, how can I seamlessly transition from the expired .ts fragment to the new .ts fragment? #6641

Open baiachen opened 2 months ago

baiachen commented 2 months ago

What do you want to do with Hls.js?

.ts file expired in response to 403, Hls.ErrorTypes.NETWORK_ERROR loadSource The new .m3u8 will load the .ts file from scratch, how can I seamlessly transition from the expired .ts fragment to the new .ts fragment?

What have you tried so far?

No response

baiachen commented 2 months ago

I'm now replacing the valid .ts file url by overriding fLoader.context.url, instead of using the hls.loadSource method to load the new .m3u8, which would cause a reload of the video being played, which sucks!

robwalch commented 2 months ago

I'm now replacing the valid .ts file url by overriding fLoader.context.url, instead of using the hls.loadSource method to load the new .m3u8, which would cause a reload of the video being played, which sucks!

hls.loadSource always resets and reloads the HLS asset.

robwalch commented 2 months ago

You should look into using Content Steering to clone and replace variant and rendition URLs to a new pathway if you need to change the path to media playlists and their segments.

robwalch commented 2 months ago

Pathway cloning is only available via steering manifest. If you have tokens that expire you should implement a steering manifest. The v1.6 release will include the ability to set the pathway (#6295). There is no client-side API to clone pathways.