IT. Expert System.

Android Reference

MediaRouter


android.media

Class MediaRouter



  • public class MediaRouter
    extends Object
    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() of a Context.MEDIA_ROUTER_SERVICE.

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

    • Field Detail

      • ROUTE_TYPE_LIVE_AUDIO

        public static final int ROUTE_TYPE_LIVE_AUDIO
        Route type flag for live audio.

        A device that supports live audio routing will allow the media audio stream to be routed to supported destinations. This can include internal speakers or audio jacks on the device itself, A2DP devices, and more.

        Once initiated this routing is transparent to the application. All audio played on the media stream will be routed to the selected destination.

        See Also:
        Constant Field Values
      • ROUTE_TYPE_LIVE_VIDEO

        public static final int ROUTE_TYPE_LIVE_VIDEO
        Route type flag for live video.

        A device that supports live video routing will allow a mirrored version of the device's primary display or a customized Presentation to be routed to supported destinations.

        Once initiated, display mirroring is transparent to the application. While remote routing is active the application may use a Presentation to replace the mirrored view on the external display with different content.

        See Also:
        MediaRouter.RouteInfo.getPresentationDisplay(), Presentation, Constant Field Values
      • ROUTE_TYPE_USER

        public static final int ROUTE_TYPE_USER
        Route type flag for application-specific usage.

        Unlike other media route types, user routes are managed by the application. The MediaRouter will manage and dispatch events for user routes, but the application is expected to interpret the meaning of these events and perform the requested routing tasks.

        See Also:
        Constant Field Values
    • Constructor Detail

      • MediaRouter

        public MediaRouter(Context context)
    • Method Detail

      • getSelectedRoute

        public MediaRouter.RouteInfo getSelectedRoute(int type)
        Return the currently selected route for the given types
        Parameters:
        type - route types
        Returns:
        the selected route
      • addCallback

        public void addCallback(int types,
                       MediaRouter.Callback cb)
        Add a callback to listen to events about specific kinds of media routes. If the specified callback is already registered, its registration will be updated for any additional route types specified.
        Parameters:
        types - Types of routes this callback is interested in
        cb - Callback to add
      • removeCallback

        public void removeCallback(MediaRouter.Callback cb)
        Remove the specified callback. It will no longer receive events about media routing.
        Parameters:
        cb - Callback to remove
      • selectRoute

        public void selectRoute(int types,
                       MediaRouter.RouteInfo route)
        Select the specified route to use for output of the given media types.
        Parameters:
        types - type flags indicating which types this route should be used for. The route must support at least a subset.
        route - Route to select
      • getCategoryCount

        public int getCategoryCount()
        Return the number of categories currently represented by routes known to this MediaRouter.
        Returns:
        the number of unique categories represented by this MediaRouter's known routes
      • getCategoryAt

        public MediaRouter.RouteCategory getCategoryAt(int index)
        Return the category at the given index. Valid indices are in the range [0-getCategoryCount).
        Parameters:
        index - which category to return
        Returns:
        the category at index
      • getRouteCount

        public int getRouteCount()
        Return the number of routes currently known to this MediaRouter.
        Returns:
        the number of routes tracked by this router
      • getRouteAt

        public MediaRouter.RouteInfo getRouteAt(int index)
        Return the route at the specified index.
        Parameters:
        index - index of the route to return
        Returns:
        the route at index
      • createRouteCategory

        public MediaRouter.RouteCategory createRouteCategory(CharSequence name,
                                                    boolean isGroupable)
        Create a new route category. Each route must belong to a category.
        Parameters:
        name - Name of the new category
        isGroupable - true if routes in this category may be grouped with one another
        Returns:
        the new RouteCategory
      • createRouteCategory

        public MediaRouter.RouteCategory createRouteCategory(int nameResId,
                                                    boolean isGroupable)
        Create a new route category. Each route must belong to a category.
        Parameters:
        nameResId - Resource ID of the name of the new category
        isGroupable - true if routes in this category may be grouped with one another
        Returns:
        the new RouteCategory


Content

Android Reference

Java basics

Java Enterprise Edition (EE)

Java Standard Edition (SE)

SQL

HTML

PHP

CSS

Java Script

MYSQL

JQUERY

VBS

REGEX

C

C++

C#

Design patterns

RFC (standard status)

RFC (proposed standard status)

RFC (draft standard status)

RFC (informational status)

RFC (experimental status)

RFC (best current practice status)

RFC (historic status)

RFC (unknown status)

IT dictionary

License.
All information of this service is derived from the free sources and is provided solely in the form of quotations. This service provides information and interfaces solely for the familiarization (not ownership) and under the "as is" condition.
Copyright 2016 © ELTASK.COM. All rights reserved.
Site is optimized for mobile devices.
Downloads: 246 / 158697755. Delta: 0.00527 с