What problem does it solve?
Adding Google Cast support to an Android media app involves coordinating build dependencies, manifest configuration, player architecture, and UI integration, and migrating from the legacy Cast SDK adds further risk of compilation errors and broken playback.
Core Features & Use Cases
- Dependency and Manifest Setup: Adds the media3-cast dependency (version 1.9.0 or higher), declares the DefaultCastOptionsProvider, and ensures correct permissions.
- Player Architecture: Initializes ExoPlayer and CastPlayer inside a MediaSessionService, with optional RemoteCastPlayer support and playback state transfer between local and remote devices.
- UI Integration: Configures the MediaRouteButton composable for Compose UIs or MediaRouteButtonFactory for View-based UIs, including recomposition and rebinding on device changes.
- Use Case: When migrating an app from the legacy Google Cast SDK to Jetpack Media3, this Skill guides replacing forwarding player wrappers with CastPlayer while keeping legacy code intact until cleanup is explicitly requested.
Quick Start
Add Google Cast support to my Android media app using Jetpack Media3 CastPlayer.