fix(web): forward contentprotectionerror events to React Native layer#857
Closed
tvanlaerhoven wants to merge 4 commits into
Closed
fix(web): forward contentprotectionerror events to React Native layer#857tvanlaerhoven wants to merge 4 commits into
tvanlaerhoven wants to merge 4 commits into
Conversation
The web THEOplayer SDK fires contentprotectionerror as a separate event from the regular error event. The WebEventForwarder was only listening for 'error' events, causing DRM/content protection errors to be silently dropped on the web platform. On native (Android/iOS), content protection errors already come through as regular ERROR events with content-protection-specific error codes. Forward the web SDK's contentprotectionerror as a PlayerEventType.ERROR to make behavior consistent across all platforms. Co-Authored-By: tom.vanlaerhoven <tom.vanlaerhoven@dolby.com>
Contributor
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
Co-Authored-By: tom.vanlaerhoven <tom.vanlaerhoven@dolby.com>
Member
Author
|
Suggest a CHANGELOG entry that I can simply confirm & commit if OK. |
Contributor
|
Here's a suggested CHANGELOG entry under ### Fixed
- Fixed an issue on Web where `contentprotectionerror` events from the THEOplayer SDK were not forwarded to the React Native layer, causing DRM-related errors to be silently dropped. |
Member
Author
|
More concise: |
Co-Authored-By: tom.vanlaerhoven <tom.vanlaerhoven@dolby.com>
Contributor
|
Added to CHANGELOG with your wording in f18d962. |
Co-Authored-By: tom.vanlaerhoven <tom.vanlaerhoven@dolby.com>
Member
Author
|
contentprotectionerror needs to be forwarded as a separate event |
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.
Summary
The web THEOplayer SDK fires
contentprotectionerroras a separate event fromerror.WebEventForwarderonly listened for'error', so DRM/content protection errors were silently dropped on web.On native (Android/iOS), content protection errors already arrive as regular
PlayerEventType.ERRORevents (withErrorCode.CONTENT_PROTECTION_ERROR). This fix makes web consistent by forwardingcontentprotectionerrorasPlayerEventType.ERROR:// WebEventForwarder.ts — addEventListeners() this._player.addEventListener('error', this.onError); + this._player.addEventListener('contentprotectionerror', this.onContentProtectionError); // New handler — maps ContentProtectionErrorEvent → DefaultErrorEvent + private readonly onContentProtectionError = (event: NativeContentProtectionErrorEvent) => { + this._facade.dispatchEvent( + new DefaultErrorEvent({ + errorCode: event.errorObject.code.toString(), + errorMessage: event.errorObject.message, + }), + ); + };Link to Devin session: https://dolby.devinenterprise.com/sessions/4f3f8d74c30b45dfb651a76c65693a83
Requested by: @tvanlaerhoven