Agent skill · android
media3-cast-integration
Implements Google Cast support in Android apps using Jetpack Media3.
What it needs
About 5k tokens when loaded.
What this skill does
Prerequisites Jetpack Media3 version must be >= 1.9.0. Cast isn't available in lower versions. Glossary CastPlayer : Media3 Player that controls playback on both local and remote Cast devices. RemoteCastPlayer : Media3 Player that communicates with a Cast receiver, only used for remote playback. Google Cast SDK: Legacy casting SDK in maintenance mode, superseded by Jetpack Media3. OptionsProvider : Interface providing configuration options to initialize GMS CastContext. Common guidelines Legacy Google Cast SDK is in maintenance mode. For new Cast setups: You must use Jetpack Media3 Cast. You mustn't use legacy Cast SDK unless explicitly requested. Step 1: Set up dependencies To complete this step, you MUST ensure the following: In the app-level build file, declare the media3-cast dependency version 1.9.0 or higher. implementation("androidx.media3:media3-cast:1.11.0") Ensure required Media3 dependencies are present: androidx.media3:media3-exoplayer androidx.media3:media3-session androidx.media3:media3-ui-compose If the application uses legacy Views, add media3-ui. Enforce the same versions across all Media3 dependencies. Use configurations in "Add build dependencies" section of Getting started with CastPlayer as the source of truth. For apps without an existing Cast integration: Verify legacy Cast SDK (libs.play.services.cast.framework) is absent. If Migrating from Legacy Cast SDK: Add Media3 Cast dependencies first. Keep existing legacy dependencies untouched at this stage to prevent compilation errors. Step 2: Update the manifest To complete this step, you MUST ensure the following: Inside the manifest's <application> tag, declare the Cast options provider. Use DefaultCastOptionsProvider by default. See the "OptionsProvider" section in Getting started with CastPlayer. Declare a custom OptionsProvider only if explicitly requested. See Customize CastOptions. Ensure INTERNET permission is present. Don't add any unnecessary permissions. …
How to use it
Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:
@skills android/media3-cast-integration