共用方式為


MediaRouter Class

Definition

This API is not recommended for new applications.

[Android.Runtime.Register("android/media/MediaRouter", DoNotGenerateAcw=true)]
public class MediaRouter : Java.Lang.Object
[<Android.Runtime.Register("android/media/MediaRouter", DoNotGenerateAcw=true)>]
type MediaRouter = class
    inherit Object
Inheritance
MediaRouter
Attributes

Remarks

This API is not recommended for new applications. Use the AndroidXMedia Router Library for consistent behavior across all devices.

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) Context.getSystemService() of a Context#MEDIA_ROUTER_SERVICE Context.MEDIA_ROUTER_SERVICE.

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

Java documentation for android.media.MediaRouter.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Constructors

MediaRouter(IntPtr, JniHandleOwnership)

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

Fields

CallbackFlagPerformActiveScan
Obsolete.

Flag for #addCallback: Actively scan for routes while this callback is registered.

CallbackFlagUnfilteredEvents
Obsolete.

Flag for #addCallback: Do not filter route events.

RouteTypeLiveAudio
Obsolete.

Route type flag for live audio.

RouteTypeLiveVideo
Obsolete.

Route type flag for live video.

RouteTypeUser
Obsolete.

Route type flag for application-specific usage.

Properties

CategoryCount

Return the number of MediaRouter.RouteCategory categories currently represented by routes known to this MediaRouter.

Class

Returns the runtime class of this Object.

(Inherited from Object)
DefaultRoute

Gets the default route for playing media content on the system.

Handle

The handle to the underlying Android instance.

(Inherited from Object)
JniIdentityHashCode (Inherited from Object)
JniPeerMembers
PeerReference (Inherited from Object)
RouteCount

Return the number of MediaRouter.RouteInfo routes currently known to this MediaRouter.

ThresholdClass

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

ThresholdType

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

Methods

AddCallback(MediaRouteType, MediaRouter+Callback, MediaRouterCallbackFlags)

Add a callback to listen to events about specific kinds of media routes.

AddCallback(MediaRouteType, MediaRouter+Callback)

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.

Clone()

Creates and returns a copy of this object.

(Inherited from Object)
CreateRouteCategory(ICharSequence, Boolean)

Create a new route category.

CreateRouteCategory(Int32, Boolean)

Create a new route category.

CreateRouteCategory(String, Boolean)

Create a new route category.

CreateUserRoute(MediaRouter+RouteCategory)

Create a new user route that may be modified and registered for use by the application.

Dispose() (Inherited from Object)
Dispose(Boolean) (Inherited from Object)
Equals(Object)

Indicates whether some other object is "equal to" this one.

(Inherited from Object)
GetCategoryAt(Int32)

Return the MediaRouter.RouteCategory category at the given index.

GetHashCode()

Returns a hash code value for the object.

(Inherited from Object)
GetRouteAt(Int32)

Return the route at the specified index.

GetSelectedRoute(MediaRouteType)

Return the currently selected route for any of the given types

JavaFinalize()

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.

(Inherited from Object)
Notify()

Wakes up a single thread that is waiting on this object's monitor.

(Inherited from Object)
NotifyAll()

Wakes up all threads that are waiting on this object's monitor.

(Inherited from Object)
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.

SetHandle(IntPtr, JniHandleOwnership)

Sets the Handle property.

(Inherited from Object)
ToArray<T>() (Inherited from Object)
ToString()

Returns a string representation of the object.

(Inherited from Object)
UnregisterFromRuntime() (Inherited from Object)
Wait()

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>.

(Inherited from Object)
Wait(Int64, Int32)

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed.

(Inherited from Object)
Wait(Int64)

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed.

(Inherited from Object)

Explicit Interface Implementations

IJavaPeerable.Disposed() (Inherited from Object)
IJavaPeerable.DisposeUnlessReferenced() (Inherited from Object)
IJavaPeerable.Finalized() (Inherited from Object)
IJavaPeerable.JniManagedPeerState (Inherited from Object)
IJavaPeerable.SetJniIdentityHashCode(Int32) (Inherited from Object)
IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates) (Inherited from Object)
IJavaPeerable.SetPeerReference(JniObjectReference) (Inherited from Object)

Extension Methods

JavaCast<TResult>(IJavaObject)

Performs an Android runtime-checked type conversion.

JavaCast<TResult>(IJavaObject)
GetJniTypeName(IJavaPeerable)

Applies to