fix(eme-controller): unhandled type error depending on promise state#7877
Open
bwallberg wants to merge 1 commit into
Open
fix(eme-controller): unhandled type error depending on promise state#7877bwallberg wants to merge 1 commit into
bwallberg wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR will...
Add missing
throwIfDestroyed()after keySystemAccess has resolved, this prevents the promise chain to continue in an invalid state resulting in type errors due to expectation ofthis.configto exist.I also added a catch to the
this.keyFormatPromisethat is "cached" untilonMediaEncryptedis called, this prevents an unhandled promise rejection from surfacing to the consumer if it occurs beforeonMediaEncryptedis called.It's fairly easy to reproduce when playing any DRM protected media with a #EXT-X-SESSION-KEY in the manster manifest, just add the following to your code ( I haven't seen it myself for real but can see it in bugsnag ).
Why is this Pull Request needed?
Unhandled promise rejection surfaces to the consumer of hls.js eg. to bugsnag/sentry etc unnecessarily as the rejection thrown after the hls.js has been destroyed.
Are there any points in the code the reviewer needs to double check?
The
this.keyFormatPromise.catch(() => {});silents an error until the media element detects the media is encrypted, a nicer solution might be to handle the error but not consider it fatal, but that has more impact on the API.Resolves issues:
Checklist