Android Guides | Samples

Android.Media.MediaRouter Class

MediaRouter allows applications to control the routing of media channels and streams from the current device to external speakers and destination devices.

See Also: MediaRouter

Syntax

[Android.Runtime.Register("android/media/MediaRouter", DoNotGenerateAcw=true)]
public class MediaRouter : Object

Remarks

MediaRouter allows applications to control the routing of media channels and streams from the current device to external speakers and destination devices.

A MediaRouter is retrieved through Context.GetSystemService(String) of a Context.MediaRouterService.

The media router API is not thread-safe; all interactions with it must be done from the main thread of the process.

[Android Documentation]

Requirements

Namespace: Android.Media
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 16

The members of Android.Media.MediaRouter are listed below.

See Also: Object

Protected Constructors

A constructor used when creating managed representations of JNI objects; called by the runtime.

Public Fields

const
CallbackFlagPerformActiveScanMediaRouterCallbackFlags (1). Flag for MediaRouter.AddCallback(MediaRouteType, .Callback): Actively scan for routes while this callback is registered.
const
CallbackFlagUnfilteredEventsMediaRouterCallbackFlags (2). Flag for MediaRouter.AddCallback(MediaRouteType, .Callback): Do not filter route events.
const
RouteTypeLiveAudioMediaRouteType (1). Route type flag for live audio.
const
RouteTypeLiveVideoMediaRouteType (2). Route type flag for live video.
const
RouteTypeUserMediaRouteType (8388608). Route type flag for application-specific usage.

Public Properties

[read-only]
CategoryCountInt32. Return the number of NoType:android/media/MediaRouter$RouteCategory;Href=../../../reference/android/media/MediaRouter.RouteCategory.html currently represented by routes known to this MediaRouter.
[read-only]
DefaultRouteMediaRouter+RouteInfo. Gets the default route for playing media content on the system.
[read-only]
RouteCountInt32. Return the number of NoType:android/media/MediaRouter$RouteInfo;Href=../../../reference/android/media/MediaRouter.RouteInfo.html currently known to this MediaRouter.

Protected Properties

[read-only]
override
ThresholdClassIntPtr. This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.
[read-only]
override
ThresholdTypeType. This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

Public Methods

AddCallback(MediaRouteType, MediaRouter+Callback)
Add a callback to listen to events about specific kinds of media routes.
AddCallback(MediaRouteType, MediaRouter+Callback, MediaRouterCallbackFlags)
Add a callback to listen to events about specific kinds of media routes.
AddUserRoute(MediaRouter+UserRouteInfo)
Add an app-specified route for media to the MediaRouter.
ClearUserRoutes()
Remove all app-specified routes from the MediaRouter.
CreateRouteCategory(ICharSequence, Boolean) : MediaRouter+RouteCategory
Create a new route category.
CreateRouteCategory(Int32, Boolean) : MediaRouter+RouteCategory
Create a new route category.
CreateRouteCategory(String, Boolean) : MediaRouter+RouteCategory
CreateUserRoute(MediaRouter+RouteCategory) : MediaRouter+UserRouteInfo
Create a new user route that may be modified and registered for use by the application.
GetCategoryAt(Int32) : MediaRouter+RouteCategory
Return the NoType:android/media/MediaRouter$RouteCategory;Href=../../../reference/android/media/MediaRouter.RouteCategory.html at the given index.
GetRouteAt(Int32) : MediaRouter+RouteInfo
Return the route at the specified index.
GetSelectedRoute(MediaRouteType) : MediaRouter+RouteInfo
Return the currently selected route for any of the given types
RemoveCallback(MediaRouter+Callback)
Remove the specified callback.
RemoveUserRoute(MediaRouter+UserRouteInfo)
Remove an app-specified route for media from the MediaRouter.
SelectRoute(MediaRouteType, MediaRouter+RouteInfo)
Select the specified route to use for output of the given media types.