feat: add contentprotectionerror player event on all platforms - #859
Conversation
🤖 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>
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>
58c8eb5 to
e7abca9
Compare
| var onNativeRateChange: RCTDirectEventBlock? | ||
| var onNativeWaiting: RCTDirectEventBlock? | ||
| var onNativeCanPlay: RCTDirectEventBlock? | ||
| var onNativeContentProtectionError: RCTDirectEventBlock? |
There was a problem hiding this comment.
🔍 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.
Was this helpful? React with 👍 or 👎 to provide feedback.
Summary
Adds a new
contentprotectionerrorplayer 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 exposesPlayerEventTypes.CONTENT_PROTECTION_ERROR(not available in THEOplayerSDK-core 11.5.0).TypeScript API:
PlayerEventType.CONTENT_PROTECTION_ERROR = 'contentprotectionerror'added to the enumContentProtectionErrorEventinterface with anerror: ContentProtectionErrorObjectpayloadContentProtectionErrorObjectcarrieserrorCode,errorMessage, and optional DRM-specific fields:url,status,statusText,response,systemCodeDefaultContentProtectionErrorEventimplementation class +NativeContentProtectionErrorEventnative bridge interfacePlatform forwarding:
WebEventForwarderlistens on'contentprotectionerror'from the Web SDK, mapserrorObjectfields (code, message, url, status, statusText, response, systemCode) intoDefaultContentProtectionErrorEventPlayerEventEmitterregistersPlayerEventTypes.CONTENTPROTECTIONERROR, forwardserrorObject.codeandmessageviaPayloadBuilder.error()onNativeContentProtectionError) registered inTHEOplayerRCTBridge.m,THEOplayerRCTView.swift, andTHEOplayerRCTMainEventHandler.swift. Native SDK listener deferred —PlayerEventTypes.CONTENT_PROTECTION_ERRORdoes not exist in THEOplayerSDK-core 11.5.0.onNativeContentProtectionErrorcallback wired in the render methodFollows the same pattern as existing error events (
ErrorEvent,ChromecastErrorEvent).Link to Devin session: https://dolby.devinenterprise.com/sessions/76fe44cf882d4024aa2714622570d537
Requested by: @tvanlaerhoven