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

how to preload and change m3u8 file?

Open hhxiaohei opened this issue 2 years ago • 0 comments

What do you want to do with Hls.js?

I have a.m3u8 and b.m3u8(reverse by a.m3u8), default play a.m3u8,now I need to do click a button play some time b.m3u8.

a.m3u8 duration time is 100s ,current a.m3u8 time is 10s, click button to b.m3u8 is 90s.

`const now_current_time = state.videoContext.duration - state.videoContext.currentTime;

hls.value.detachMedia(); hls.value.loadSource(video_url);

state.videoContext.currentTime = now_current_time; hls.value.attachMedia(video); hls.value.on(Hls.Events.MANIFEST_PARSED,()=>{ playVideo(); })`

it is very slow,how to do it?thx

What have you tried so far?

No response

hhxiaohei avatar Jul 01 '22 08:07 hhxiaohei