Skip to content

Fix Widevine KEYID parsing #7380

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 7, 2025
Merged

Fix Widevine KEYID parsing #7380

merged 1 commit into from
Jul 7, 2025

Conversation

robwalch
Copy link
Collaborator

@robwalch robwalch commented Jul 4, 2025

This PR will...

Fix Widevine key management

  • Use the Key ID in EXT-X-KEY KEYID when available for Widevine
  • Deduplicate key data with the same attributes when parsing media playlists
  • Ignore data in "encrypted" event (hls.js can't reliably parse the key id from PSSH without a Widevine protobuf parser)

Why is this Pull Request needed?

The Widevine PSSH key id parsing in hls.js (read the 16 bytes 6 bytes back from the end) assumes no optional fields and can't always extract the key id that vendors are including in the playlist (the key id matching tenc box bytes and KEYID attribute value). Since it is difficult to match the "encrypted" event initdata to key tags in the playlist without being able to extract a matching key id, it is better to ignore the event and rely only on key data which is required to be included in HLS media playlists.

Are there any points in the code the reviewer needs to double check?

Resolves issues:

Fixes #7369

Checklist

  • changes have been done against master branch, and PR does not conflict
  • new unit / functional tests have been added (whenever applicable)
  • API or design changes are documented in API.md

@robwalch robwalch added this to the 1.6.7 milestone Jul 4, 2025
@robwalch robwalch requested a review from cjpillsbury July 4, 2025 03:45
@robwalch robwalch marked this pull request as ready for review July 4, 2025 03:58
@robwalch robwalch added the DRM label Jul 6, 2025
@robwalch robwalch enabled auto-merge (rebase) July 7, 2025 17:01
@robwalch robwalch disabled auto-merge July 7, 2025 17:01
@robwalch robwalch merged commit e3e9659 into master Jul 7, 2025
16 checks passed
@robwalch robwalch deleted the bugfix/widevine-keyid branch July 7, 2025 17:02
robwalch added a commit that referenced this pull request Jul 30, 2025
Fixes regression introduced in v1.6.7 with #7380
@robwalch robwalch mentioned this pull request Jul 30, 2025
3 tasks
robwalch added a commit that referenced this pull request Jul 31, 2025
Fixes regression introduced in v1.6.7 with #7380
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

No Playback of fmp4 + CBCS w/ Widevine
1 participant