Skip to content

fix: cast-aware reconfigure to preserve Chromecast session#221

Open
Jmilham21 wants to merge 1 commit intomasterfrom
bugfix/cast-aware-reconfigure
Open

fix: cast-aware reconfigure to preserve Chromecast session#221
Jmilham21 wants to merge 1 commit intomasterfrom
bugfix/cast-aware-reconfigure

Conversation

@Jmilham21
Copy link
Copy Markdown
Collaborator

Summary

  • When Chromecast is active and a config change is triggered from React Native, recreatePlayerWithConfig was calling configurePlayer which reinitializes the player and tears down the SDK's internal CastProvider, killing the cast session.
  • Now uses loadPlaylist instead of configurePlayer when actively casting, preserving the cast session while loading new content.
  • Fixes podspec flag accumulation bug where USE_GOOGLE_CAST was silently dropped when both Cast and IMA were enabled.
  • Fixes setUpCastController crash (playerView.player as! Bool) and adds support for playerViewController.
  • Properly tracks isCasting state in cast delegate callbacks.

Blocked on native SDK change

This PR is awaiting a native iOS SDK (JWPlayerKit) update to expose a public method for parsing Delivery API JSON into JWPlayerItem objects. Once available, the RN wrapper can use it to properly parse playlist items during casting, ensuring DRM sources/credentials are correctly forwarded to the cast receiver.

Non-DRM casting works as expected with the current changes.

Test plan

  • Verify non-DRM content can be cast and config changes (e.g. loading new playlist) preserve the cast session
  • Verify the cast session is not torn down on config changes while casting
  • Verify full player recreation (license/viewOnly change) gracefully handles active cast sessions
  • Verify both Cast and IMA flags compile correctly together (podspec fix)
  • Pending: DRM content casting after native SDK update

…fig changes

When casting, use loadPlaylist instead of configurePlayer to avoid
tearing down the SDK's CastProvider. Also fixes podspec flag
accumulation, setUpCastController crash, and isCasting tracking.
@Jmilham21 Jmilham21 requested a review from a team as a code owner March 28, 2026 01:56
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.

1 participant