videojs / http-streaming

HLS, DASH, and future HTTP streaming protocols library for video.js
https://videojs-http-streaming.netlify.app/
Other
2.45k stars 418 forks source link

fix: keyId filtering loadedplaylist listener and improvements #1468

Closed adrums86 closed 6 months ago

adrums86 commented 6 months ago

Description

After doing some further testing with HLS and playlist exclusion by keyId, it became apparent some more fixes were needed to properly request and filter all possible variants.

I also added a fallback mechanism and additional logging. I was testing another asset with no matching keys and it seemed necessary to at least TRY and play the non-HD playlists if we have previously excluded them due to non-usable or non-matching keyIds.

Specific Changes proposed

Listening to loadedplaylist and calling excludeNonUsablePlaylistsByKeyId_ and fastQualityChange when a new playlist is loaded. This allows the playlist-controller to check the keyId in the loaded or refreshed playlist for an HLS variant, or a refreshed DASH manifest.

Also, add a conditional after the playlist exclusion loop that checks if we excluded all of the playlists due to non-usable status or non-matching keys and re-includes all the SD playlists and logs a warning. This provides VHS with a bit more resilience against unexpected manifests or license data.

Requirements Checklist

codecov[bot] commented 6 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (88a5671) 86.02% compared to head (4eeafc5) 86.12%. Report is 1 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1468 +/- ## ========================================== + Coverage 86.02% 86.12% +0.09% ========================================== Files 42 42 Lines 10708 10781 +73 Branches 2461 2490 +29 ========================================== + Hits 9212 9285 +73 Misses 1496 1496 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.