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 |
Constants |
|
|---|---|
const MediaRouteSelector! |
An empty media route selector that will not match any routes. |
Public functions |
|
|---|---|
Bundle |
asBundle()Converts this object to a bundle for serialization. |
Boolean |
contains(selector: MediaRouteSelector)Returns true if this selector contains all of the capabilities described by the specified selector. |
Boolean |
|
java-static MediaRouteSelector? |
fromBundle(bundle: Bundle?)Creates an instance from a bundle. |
(Mutable)List<String!> |
Gets the list of |
Boolean |
hasControlCategory(category: String?)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(filters: (Mutable)List<IntentFilter!>?)Returns true if the selector matches at least one of the specified control filters. |
String |
toString() |
Constants
EMPTY
const val EMPTY: MediaRouteSelector!
An empty media route selector that will not match any routes.
Public functions
asBundle
fun asBundle(): Bundle
Converts this object to a bundle for serialization.
| Returns | |
|---|---|
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. |
| Returns | |
|---|---|
Boolean |
True if this selector contains all of the capabilities described by the specified selector. |
fromBundle
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
fun getControlCategories(): (Mutable)List<String!>
Gets the list of media control categories in the selector.
hasControlCategory
fun hasControlCategory(category: String?): Boolean
Returns true if the selector contains the specified category.
| Parameters | |
|---|---|
category: String? |
The category to check. |
| Returns | |
|---|---|
Boolean |
|
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: (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. |