media3-cast-integration
Compact skill for Media3 CastPlayer.Builder, automatic local/remote handoff, MediaRouteButton, and Cast session lifecycle.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Compact skill for Media3 CastPlayer.Builder, automatic local/remote handoff, MediaRouteButton, and Cast session lifecycle.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | media3-cast-integration |
| description | Compact skill for Media3 CastPlayer.Builder, automatic local/remote handoff, MediaRouteButton, and Cast session lifecycle. |
| license | Apache-2.0 |
| metadata | {"author":"Shunnek Labs","version":"1.2","target_media3_version":"1.10.1","last_reviewed":"2026-07-23","keywords":["android","media3","cast","chromecast","castplayer","remotecastplayer","mediaroutebutton","handoff"]} |
Use for Chromecast/Cast support and local player to remote receiver handoff.
streaming-media-architecture for ownership, KMP split, preload window, and telemetry.1.10.1 through the version catalog.CastPlayer constructors are deprecated since Media3 1.9.0. You MUST build with CastPlayer.Builder and .setLocalPlayer(exoPlayer) for combined local plus remote playback, or with RemoteCastPlayer.Builder for remote-only control.CastPlayer built with setLocalPlayer handles local/remote transitions automatically when a Cast session starts or ends. DO NOT hand-swap players in UI or session code.CastPlayer in exactly one MediaSession inside your MediaSessionService; controllers, notification, and media buttons then follow handoff without extra code.com.google.android.gms.cast.framework.OPTIONS_PROVIDER_CLASS_NAME pointing to androidx.media3.cast.DefaultCastOptionsProvider or a custom OptionsProvider.androidx.mediarouter MediaTransferReceiver so the system Output Switcher can move playback between local and remote devices.media3-cast = { module = "androidx.media3:media3-cast", version.ref = "media3" }
val castPlayer = CastPlayer.Builder(context)
.setLocalPlayer(exoPlayer)
.build()
val mediaSession = MediaSession.Builder(this, castPlayer).build()
<meta-data
android:name="com.google.android.gms.cast.framework.OPTIONS_PROVIDER_CLASS_NAME"
android:value="androidx.media3.cast.DefaultCastOptionsProvider" />
media3-background-playback-servicemedia3-video-playbackCompact skill for Media3 Google IMA CSAI/SSAI ad insertion, AdViewProvider, companions, and ad telemetry.
Compact skill for Media3 MediaSessionService, MediaController, notification, media buttons, and service lifetime.
Compact skill for Media3 offline downloads with DownloadService, DownloadManager, Requirements, and the WorkManagerScheduler role of media3-exoplayer-workmanager.
Compact skill for Media3 bandwidth estimation, ABR limits, load control, network constraints, and preload contention.
Compact skill for Media3 HTTP DataSource, OkHttp/Cronet/HttpEngine, cache, headers, auth, and custom DataSource decisions.
Compact skill for Media3 inspector metadata, thumbnail/frame extraction, and container sample inspection without playback.