Skip to content

Most visited

Recently visited

navigation

Media Routing

As users connect their televisions, home theater systems, and music players with wireless technologies, they want to be able to play content from Android apps on these larger, louder devices. Enabling this kind of playback can turn your one-device, one-user app into a shared experience that delights and inspires multiple users.

The Android media router APIs are designed to enable media display and playback on remote receiver devices using a common user interface. App developers that implement a MediaRouter interface can then connect to the framework and play content to devices that participate in the media router framework. Media playback device manufacturers can participate in the framework by publishing a MediaRouteProvider that allows other applications to connect to and play media on the receiver devices. Figure 1 illustrates how an app connects to a receiver device through the media router framework.

Figure 1. Overview of how media route provider classes provide communication from a media app to a receiver device.

Note: If you want your app to support Google Cast devices, you should use the Cast SDK and build your app as a Cast sender. Follow the directions in the Cast documentation instead of using the MediaRouter framework directly.

Mediarouter support library

The mediarouter APIs are defined in the v7-mediarouter support library. This library is compatible with devices running Android 2.3 (API level 9) and higher and ensures a consistent experience across all of them. For detailed information about the mediarouter APIs, see the android.support.v7.media package in the API reference.

MediaRouter API
A media app uses the MediaRouter API to discover available remote playback devices and to route audio and video to them.
MediaRouteProvider API
The MediaRouteProvider API defines the capabilities of a remote playback device and makes it visible to apps that use a MediaRouter to search for alternative media paths.
This site uses cookies to store your preferences for site-specific language and display options.

Get the latest Android developer news and tips that will help you find success on Google Play.

* Required Fields

Hooray!

Browse this site in ?

You requested a page in , but your language preference for this site is .

Would you like to change your language preference and browse this site in ? If you want to change your language preference later, use the language menu at the bottom of each page.

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.

Take a short survey?
Help us improve the Android developer experience.
(Sep 2017 survey)