vime icon indicating copy to clipboard operation
vime copied to clipboard

bug: duration/live data is not retrieved correctly in Hls provider

Open rossng opened this issue 4 years ago • 0 comments

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 live information from hls.js should be respected when setting the duration in the HLS provider.
  • The duration should be updated on LEVEL_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.

rossng avatar Jul 12 '21 11:07 rossng