bug: duration/live data is not retrieved correctly in Hls provider
Bug Report
Vime version: 5.0.31
Provider:
[] Audio [] Video [x] HLS [] DASH [] YouTube [] Vimeo [] Dailymotion
Current behavior:
Vime determines whether a stream is live by comparing the duration to Infinity. The HLS provider uses the LevelDetails.totalduration from hls.js. Looking at hls.js, I think this will always be a finite number regardless of whether the stream is live or not.
The duration update in the provider is triggered by the LEVEL_LOADED event. However, this event doesn't fire for a non-live playlist that has already been loaded and cached by hls.js. This could result in the duration being set incorrectly if there are multiple levels with different durations - which is a weird usecase but I don't think it actually violates the HLS spec.
Expected behavior:
- The
liveinformation fromhls.jsshould be respected when setting the duration in the HLS provider. - The
durationshould be updated onLEVEL_SWITCHED
Steps to reproduce:
Related code:
insert short code snippets here
Other information:
I will probably submit a PR for this but would appreciate any suggestions.