Guide · Agent skill
How to use the Media3 Cast Integration agent skill
Updated · written with AI from the project's own documentation and checked against our catalogue data
The media3-cast-integration skill is a set of instructions that teaches an AI coding agent how to add Google Cast support to an Android app built on Jetpack Media3. It is for Android developers who want the agent to follow Google's recommended Media3 Cast patterns, including teams moving off the legacy Google Cast SDK. After this guide you will know what the skill changes, how to install it, how to ask for it in plain language, and what to check before letting it edit your project.
Quick start
- 1Install the skill. Download the media3-cast-integration ZIP from the agent-skills directory page and unzip it into ~/.claude/skills/ for personal use or .claude/skills/ inside your project.
- 2Confirm your project meets the requirements. Check that your app uses a Jetpack Media3 version at or above the minimum stated in SKILL.md, and that it has Gradle build files for the app.
- 3Describe the Cast task. Ask the agent in plain language to add Cast support, or to migrate from the legacy Google Cast SDK, and say whether you use Compose or Views.
- 4Let the agent update dependencies and manifest. The agent adds the media3-cast and related Media3 libraries, then registers the Cast options provider in AndroidManifest.xml.
- 5Review the player and service changes. Check that the MediaSessionService initialises the player and passes CastPlayer to MediaSession.Builder, and that RemoteCastPlayer appears only if you asked for it.
- 6Add the cast button and player UI. Confirm the MediaRouteButton sits next to the playback controls and that the UI uses the Material3 Player composable or the View-based equivalent.
- 7Build and test on a Cast device. Build the app and test casting on a Cast-enabled device such as Android TV, Chromecast, a smart speaker or a smart display.
What does the media3-cast-integration skill make the agent do?
When the skill is installed, the agent follows a step-by-step playbook for adding Chromecast-style casting to an Android app that uses Jetpack Media3. The playbook covers adding the right Gradle dependencies, updating the app manifest with a Cast options provider, wiring CastPlayer or RemoteCastPlayer into a MediaSessionService, and building Compose or View-based cast buttons and player UI.
The skill also covers migrating away from the legacy Google Cast SDK. It describes that SDK as being in maintenance mode and superseded by Jetpack Media3, so for new Cast setups it directs the agent to use Media3 Cast unless you explicitly ask for the legacy SDK.
- Adds Media3 Cast and related Media3 dependencies to the app-level build file
- Declares a Cast options provider in AndroidManifest.xml
- Creates a CastPlayer by default, or a RemoteCastPlayer if you ask for it
- Adds a MediaRouteButton and a player UI in Compose, or uses media3-ui for View-based screens
- Migrates from legacy Cast SDK code in stages without deleting old files too early
Install the skill: download, unzip and place it
Download the ZIP file for the media3-cast-integration skill from the agent-skills directory page. Unzip it so that the skill folder, which contains SKILL.md, sits in one of the locations below.
For a skill available to all of your projects, unzip it into ~/.claude/skills/. For a skill that only applies to one project, unzip it into the .claude/skills/ folder inside that project.
If you use the Claude apps instead of local files, you can upload the skill under Settings → Capabilities → Skills.
- Personal install: ~/.claude/skills/
- Project install: .claude/skills/ inside your Android project
- Claude apps: Settings → Capabilities → Skills, then upload the skill
Check what your project needs before you start
The skill only works on an Android project that already uses Jetpack Media3 at a version the skill supports. Its prerequisite is a minimum Media3 version, and Cast is not available in older releases. If your app is on an older version and you cannot upgrade, the skill will not fit your project.
The project also needs Gradle build files for the app. The skill expects these Media3 libraries: media3-cast, media3-exoplayer, media3-session and media3-ui-compose. If your app uses legacy Views, it also expects media3-ui. All Media3 dependencies should use the same version.
- Android project using Jetpack Media3 at the minimum version stated in SKILL.md
- Gradle build files for the app
- Libraries: media3-cast, media3-exoplayer, media3-session, media3-ui-compose (media3-ui for View-based UIs)
Ask for the task in plain language
You do not need to name the skill or write special syntax. Describe the Cast work you want in ordinary words, and mention Media3 or your current setup so the agent knows which path to take. The skill's own description says it applies when you are adding Cast functionality or migrating from the legacy Cast SDK to Media3 Cast.
Good requests say what the app does, what UI you use and whether the app already has any Cast code. Requests that name a specific choice, such as a custom receiver application ID or RemoteCastPlayer, tell the agent to go beyond the defaults, because the skill uses those only when they are explicitly requested.
- Add Google Cast support to my Android media app using Jetpack Media3. It uses Compose.
- Migrate my app from the legacy Google Cast SDK to Media3 Cast. Keep the old files for now.
- Add Cast to my View-based player screen with a MediaRouteButton next to the controls.
- Set up a custom Cast receiver application ID in the Cast options provider for my Media3 app.
Follow what the agent does, step by step
The skill is organised into four steps, and the agent works through them in order. Dependencies come first, then the manifest, then the player and service, then the UI. Each step lists rules the agent must follow.
For the manifest, the skill registers DefaultCastOptionsProvider in the application tag of AndroidManifest.xml by default. It uses a custom options provider only when you ask for one. It also confirms that the INTERNET permission is present and does not add other permissions unless needed.
- Step 1: set up dependencies and confirm the versions match
- Step 2: update the manifest with the Cast options provider
- Step 3: create the player and MediaSessionService, passing CastPlayer directly to MediaSession.Builder
- Step 4: build the Compose or View-based UI with a MediaRouteButton
<application>
...
<meta-data
android:name="com.google.android.gms.cast.framework.OPTIONS_PROVIDER_CLASS_NAME"
android:value="androidx.media3.cast.DefaultCastOptionsProvider" />
...
</application>Know the RemoteCastPlayer and legacy migration rules
CastPlayer is the default. RemoteCastPlayer is an advanced option that the skill uses only when you explicitly request it. In that case the skill sets up a local ExoPlayer and a RemoteCastPlayer, and moves playback state between them when a Cast session becomes available or unavailable.
When migrating, the skill keeps existing legacy dependencies, custom options provider files and legacy class files in place at first. This avoids compilation errors during the change. Removing them is a later task you do yourself once the new setup builds.
- CastPlayer: controls playback on both local and remote Cast devices
- RemoteCastPlayer: communicates with a Cast receiver and is only used for remote playback
- OptionsProvider: provides the configuration used to initialise the Google Mobile Services CastContext
What people use it for
- Adding Cast support to a Compose-based Android music or podcast app that uses Media3 for playback
- Migrating an existing app from the legacy Google Cast SDK to Media3 Cast in stages
- Adding a MediaRouteButton and Cast-aware player screen to a View-based Android video app
- Setting up a custom Cast receiver application ID through a custom OptionsProvider when you explicitly ask for one
Frequently asked questions
Is the media3-cast-integration skill free to use?
The skill is listed under the Apache-2.0 licence. The skill's SKILL.md points to a LICENSE.txt file for the complete terms, so read that file before you reuse the skill.
What do I need to use the Media3 Cast skill?
You need an Android project that uses Jetpack Media3 at or above the minimum version the skill states, plus Gradle build files for the app. The skill also expects the media3-cast, media3-exoplayer, media3-session and media3-ui-compose libraries, and media3-ui for View-based screens.
Does this skill run scripts or use the network?
According to the skill listing, it does not run scripts and does not use the network. It works by giving the agent instructions for editing Android project code, so you still review every change the agent makes.
How do I install an agent skill like this one?
Download the ZIP from the agent-skills directory page and unzip it into ~/.claude/skills/ for personal use or into .claude/skills/ inside a project. In the Claude apps, you can instead upload it under Settings → Capabilities → Skills.
Should I use this skill or the legacy Google Cast SDK?
For new Cast setups, the skill directs the agent to use Jetpack Media3 Cast, because the legacy Google Cast SDK is in maintenance mode and superseded by Media3. The agent uses the legacy SDK only if you explicitly request it. If your project must keep the legacy SDK, this skill is not the right fit.
Why won't the agent remove my old Cast SDK code during migration?
The skill keeps legacy dependencies, custom options provider files, manifest entries and legacy class files in place at first to prevent compilation errors during migration. You remove them yourself later, once the new Media3 Cast setup builds.
New agent skills, repos and AI tools — every week
The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.
Our verdict
This skill suits Android developers who are adding Cast to a Jetpack Media3 app, or moving an existing app off the legacy Google Cast SDK, and who want an agent to follow Google's recommended patterns. It is not suited to people who only want to cast or watch media without building an app, to projects that must stay on the legacy Cast SDK, or to apps that cannot move to the Media3 version the skill requires.
Download the skill