Register now for Android Dev Summit 2019!

MediaRouteSelector

class MediaRouteSelector
kotlin.Any
   ↳ androidx.mediarouter.media.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 selectorBuilder = 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 classes

Builder for media route selectors.

Public methods

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(other: Any?)

static MediaRouteSelector!
fromBundle(@Nullable bundle: Bundle?)

Creates an instance from a bundle.

MutableList<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

Properties

static MediaRouteSelector!

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

Public methods

asBundle

fun asBundle(): Bundle!

Converts this object to a bundle for serialization.

Return
Bundle!: The contents of the object represented as a bundle.

contains

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.
Return
Boolean: True if this selector contains all of the capabilities described by the specified selector.

equals

fun equals(other: Any?): Boolean

fromBundle

static fun fromBundle(@Nullable bundle: Bundle?): MediaRouteSelector!

Creates an instance from a bundle.

Parameters
bundle Bundle?: The bundle, or null if none.
Return
MediaRouteSelector!: The new instance, or null if the bundle was null.

getControlCategories

fun getControlCategories(): MutableList<String!>!

Gets the list of media control categories in the selector.

Return
MutableList<String!>!: The list of categories.

hasControlCategory

fun hasControlCategory(category: String!): Boolean

Returns true if the selector contains the specified category.

Parameters
category String!: The category to check.
Return
Boolean: True if the category is present.

hashCode

fun hashCode(): Int

isEmpty

fun isEmpty(): Boolean

Returns true if the selector does not specify any capabilities.

isValid

fun isValid(): Boolean

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

matchesControlFilters

fun matchesControlFilters(filters: MutableList<IntentFilter!>!): Boolean

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

Parameters
filters MutableList<IntentFilter!>!: The list of control filters to consider.
Return
Boolean: True if a match is found.

toString

fun toString(): String

Properties

EMPTY

static val EMPTY: MediaRouteSelector!

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