added in version 22.1.0
belongs to Maven artifact com.android.support:mediarouter-v7:28.0.0-alpha1

MediaRouteSelector

public final class MediaRouteSelector
extends Object

java.lang.Object
   ↳ android.support.v7.media.MediaRouteSelector


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

This object is immutable once created using a MediaRouteSelector.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

class MediaRouteSelector.Builder

Builder for media route selectors

Fields

public static final MediaRouteSelector EMPTY

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

Public methods

Bundle asBundle()

Converts this object to a bundle for serialization.

boolean contains(MediaRouteSelector selector)

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

boolean equals(Object o)
static MediaRouteSelector fromBundle(Bundle bundle)

Creates an instance from a bundle.

List<String> getControlCategories()

Gets the list of media control categories in the selector.

boolean hasControlCategory(String category)

Returns true if the selector contains the specified category.

int hashCode()
boolean isEmpty()

Returns true if the selector does not specify any capabilities.

boolean isValid()

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

boolean matchesControlFilters(List<IntentFilter> filters)

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

String toString()

Inherited methods

From class java.lang.Object