Skip to content

feat: add contentprotectionerror player event on all platforms - #859

Merged
tvanlaerhoven merged 3 commits into
developfrom
devin/1782482584-content-protection-error-event
Jul 29, 2026
Merged

feat: add contentprotectionerror player event on all platforms#859
tvanlaerhoven merged 3 commits into
developfrom
devin/1782482584-content-protection-error-event

Conversation

@tvanlaerhoven

@tvanlaerhoven tvanlaerhoven commented Jun 26, 2026

Copy link
Copy Markdown
Member

Summary

Adds a new contentprotectionerror player event forwarded from the native THEOplayer SDKs on Web and Android. iOS bridge wiring is in place but the native listener is deferred until the iOS SDK exposes PlayerEventTypes.CONTENT_PROTECTION_ERROR (not available in THEOplayerSDK-core 11.5.0).

TypeScript API:

  • PlayerEventType.CONTENT_PROTECTION_ERROR = 'contentprotectionerror' added to the enum
  • ContentProtectionErrorEvent interface with an error: ContentProtectionErrorObject payload
  • ContentProtectionErrorObject carries errorCode, errorMessage, and optional DRM-specific fields: url, status, statusText, response, systemCode
  • DefaultContentProtectionErrorEvent implementation class + NativeContentProtectionErrorEvent native bridge interface

Platform forwarding:

  • Web: WebEventForwarder listens on 'contentprotectionerror' from the Web SDK, maps errorObject fields (code, message, url, status, statusText, response, systemCode) into DefaultContentProtectionErrorEvent
  • Android: PlayerEventEmitter registers PlayerEventTypes.CONTENTPROTECTIONERROR, forwards errorObject.code and message via PayloadBuilder.error()
  • iOS: Bridge property (onNativeContentProtectionError) registered in THEOplayerRCTBridge.m, THEOplayerRCTView.swift, and THEOplayerRCTMainEventHandler.swift. Native SDK listener deferred — PlayerEventTypes.CONTENT_PROTECTION_ERROR does not exist in THEOplayerSDK-core 11.5.0.
  • THEOplayerView.tsx: onNativeContentProtectionError callback wired in the render method

Follows the same pattern as existing error events (ErrorEvent, ChromecastErrorEvent).

Link to Devin session: https://dolby.devinenterprise.com/sessions/76fe44cf882d4024aa2714622570d537
Requested by: @tvanlaerhoven


Open in Devin Review

@tvanlaerhoven tvanlaerhoven self-assigned this Jun 26, 2026
@devin-ai-integration

Copy link
Copy Markdown
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

devin-ai-integration[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

@tvanlaerhoven
tvanlaerhoven requested a review from wvanhaevre July 1, 2026 08:45
devin-ai-integration Bot and others added 2 commits July 6, 2026 14:17
Co-Authored-By: tom.vanlaerhoven <tom.vanlaerhoven@dolby.com>
PlayerEventTypes.CONTENT_PROTECTION_ERROR does not exist in THEOplayerSDK-core
11.5.0. The bridge property (onNativeContentProtectionError) is kept so it can
be wired up when the iOS SDK adds this event type.

Co-Authored-By: tom.vanlaerhoven <tom.vanlaerhoven@dolby.com>
@devin-ai-integration
devin-ai-integration Bot force-pushed the devin/1782482584-content-protection-error-event branch from 58c8eb5 to e7abca9 Compare July 6, 2026 14:17

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 new potential issue.

Open in Devin Review

var onNativeRateChange: RCTDirectEventBlock?
var onNativeWaiting: RCTDirectEventBlock?
var onNativeCanPlay: RCTDirectEventBlock?
var onNativeContentProtectionError: RCTDirectEventBlock?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔍 iOS callback plumbing added but no native listener attached (deferred)

The iOS changes add the bridge property (ios/THEOplayerRCTBridge.m:50), the handler property (ios/THEOplayerRCTMainEventHandler.swift:33), and the setter (ios/THEOplayerRCTView.swift:473-477), but no player.addEventListener for content-protection errors is registered in attachListeners(). This matches the PR's stated intent that the iOS native listener is deferred until the SDK exposes the event type, so this is intentional and not a runtime bug (the prop is set but simply never invoked). Reviewer should confirm a follow-up ticket exists to wire the actual listener once the iOS SDK supports it.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

@tvanlaerhoven
tvanlaerhoven merged commit 1c2cc7f into develop Jul 29, 2026
7 of 8 checks passed
@tvanlaerhoven
tvanlaerhoven deleted the devin/1782482584-content-protection-error-event branch July 29, 2026 09:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants