-
Notifications
You must be signed in to change notification settings - Fork 31
feat: add contentprotectionerror player event on all platforms #859
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
base: develop
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -30,6 +30,7 @@ public class THEOplayerRCTMainEventHandler { | |
| var onNativeRateChange: RCTDirectEventBlock? | ||
| var onNativeWaiting: RCTDirectEventBlock? | ||
| var onNativeCanPlay: RCTDirectEventBlock? | ||
| var onNativeContentProtectionError: RCTDirectEventBlock? | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔴 Content protection error event never fires on iOS because the native SDK listener is never attached The native SDK listener for content protection errors is never registered ( Impact: The Missing listener variable, attachment, and detachment in THEOplayerRCTMainEventHandlerEvery other event in this handler follows a three-part pattern:
For
The bridge property is correctly exported ( Prompt for agentsWas this helpful? React with 👍 or 👎 to provide feedback.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is intentional. The initial commit did include the full three-part listener pattern ( THEOplayerSDK-core 11.5.0 (installed by CI) does not expose The bridge wiring is kept in place so the listener can be re-added when the iOS SDK exposes this event type in a future release. |
||
| var onNativeDimensionChange: RCTDirectEventBlock? | ||
| var onNativeVideoResize: RCTDirectEventBlock? | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| /** | ||
| * An error related to content protection. | ||
| * | ||
| * @category Errors | ||
| * @category Content Protection | ||
| * @public | ||
| */ | ||
| export interface ContentProtectionErrorObject { | ||
| /** | ||
| * The error code. | ||
| */ | ||
| readonly errorCode: string; | ||
|
|
||
| /** | ||
| * The error message. | ||
| */ | ||
| readonly errorMessage: string; | ||
|
|
||
| /** | ||
| * The URL that was used in the request. | ||
| * | ||
| * @remarks | ||
| * Only available for certificate or license request errors. | ||
| */ | ||
| readonly url?: string; | ||
|
|
||
| /** | ||
| * The status code from the HTTP response. | ||
| * | ||
| * @remarks | ||
| * Only available for certificate or license request errors. | ||
| */ | ||
| readonly status?: number; | ||
|
|
||
| /** | ||
| * The status text from the HTTP response. | ||
| * | ||
| * @remarks | ||
| * Only available for certificate or license request errors. | ||
| */ | ||
| readonly statusText?: string; | ||
|
|
||
| /** | ||
| * The body contained in the HTTP response. | ||
| * | ||
| * @remarks | ||
| * Only available for certificate or license request errors. | ||
| */ | ||
| readonly response?: string; | ||
|
|
||
| /** | ||
| * The internal error code from the CDM. | ||
| * | ||
| * @remarks | ||
| * Only available for internal CDM errors. | ||
| */ | ||
| readonly systemCode?: number; | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,3 @@ | ||
| export * from './PlayerError'; | ||
| export * from './ChromecastError'; | ||
| export * from './ContentProtectionError'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚩 iOS volumeChangeListener is never detached (pre-existing)
The
volumeChangeListeneris declared atios/THEOplayerRCTMainEventHandler.swift:45and attached at line 162, butdettachListeners()(lines 380-515) never removes it — unlike every other listener in the file (play, pause, error, etc.). This is a pre-existing resource leak, not introduced by this PR, but the newcontentProtectionErrorListenerwas correctly added to both attach and detach methods, so the PR author clearly followed the pattern. Worth fixing separately.(Refers to line 45)
Was this helpful? React with 👍 or 👎 to provide feedback.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch — confirmed this is pre-existing and out of scope for this PR. The
volumeChangeListeneris indeed attached but never removed indettachListeners(). Worth fixing in a separate PR.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good find. This is now fixed in this PR