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 |
Public methods | |
---|---|
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 | |
static MediaRouteSelector! |
fromBundle(@Nullable bundle: Bundle?) Creates an instance from a bundle. |
MutableList<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: MutableList<IntentFilter!>!) Returns true if the selector matches at least one of the specified control filters. |
String |
toString() |
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. |
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
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.