MediaRouteSelector


class MediaRouteSelector


Describes the capabilities of routes that applications would like to discover and use.

This object is immutable once created using a Builder instance.

Example

MediaRouteSelector selector = new MediaRouteSelector.Builder()
        .addControlCategory(MediaControlIntent.CATEGORY_LIVE_VIDEO)
        .addControlCategory(MediaControlIntent.CATEGORY_REMOTE_PLAYBACK)
        .build();

MediaRouter router = MediaRouter.getInstance(context);
router.addCallback(selector, callback, MediaRouter.CALLBACK_FLAG_REQUEST_DISCOVERY);

Summary

Nested types

Builder for media route selectors.

Constants

const MediaRouteSelector!

An empty media route selector that will not match any routes.

Public functions

Bundle

Converts this object to a bundle for serialization.

Boolean

Returns true if this selector contains all of the capabilities described by the specified selector.

Boolean
equals(o: Any!)
java-static MediaRouteSelector?
fromBundle(bundle: Bundle?)

Creates an instance from a bundle.

(Mutable)List<String!>

Gets the list of media control categories in the selector.

Boolean

Returns true if the selector contains the specified category.

Int
Boolean

Returns true if the selector does not specify any capabilities.

Boolean

Returns true if the selector has all of the required fields.

Boolean

Returns true if the selector matches at least one of the specified control filters.

String

Constants

EMPTY

Added in 1.1.0
const val EMPTYMediaRouteSelector!

An empty media route selector that will not match any routes.

Public functions

asBundle

Added in 1.1.0
fun asBundle(): Bundle

Converts this object to a bundle for serialization.

Returns
Bundle

The contents of the object represented as a bundle.

contains

Added in 1.1.0
fun contains(selector: MediaRouteSelector): Boolean

Returns true if this selector contains all of the capabilities described by the specified selector.

Parameters
selector: MediaRouteSelector

The selector to be examined.

Returns
Boolean

True if this selector contains all of the capabilities described by the specified selector.

equals

fun equals(o: Any!): Boolean

fromBundle

Added in 1.1.0
java-static fun fromBundle(bundle: Bundle?): MediaRouteSelector?

Creates an instance from a bundle.

Parameters
bundle: Bundle?

The bundle, or null if none.

Returns
MediaRouteSelector?

The new instance, or null if the bundle was null.

getControlCategories

Added in 1.1.0
fun getControlCategories(): (Mutable)List<String!>

Gets the list of media control categories in the selector.

Returns
(Mutable)List<String!>

The list of categories.

hasControlCategory

Added in 1.1.0
fun hasControlCategory(category: String?): Boolean

Returns true if the selector contains the specified category.

Parameters
category: String?

The category to check.

Returns
Boolean

true if the category is present.

hashCode

fun hashCode(): Int

isEmpty

Added in 1.1.0
fun isEmpty(): Boolean

Returns true if the selector does not specify any capabilities.

isValid

Added in 1.1.0
fun isValid(): Boolean

Returns true if the selector has all of the required fields.

matchesControlFilters

Added in 1.1.0
fun matchesControlFilters(filters: (Mutable)List<IntentFilter!>?): Boolean

Returns true if the selector matches at least one of the specified control filters.

Parameters
filters: (Mutable)List<IntentFilter!>?

The list of control filters to consider.

Returns
Boolean

True if a match is found.

toString

fun toString(): String