# MediaRouteActionProvider

# MediaRouteActionProvider

Artifact:[androidx.mediarouter:mediarouter](https://developer.android.com/jetpack/androidx/releases/mediarouter)  
[View Source](https://cs.android.com/search?q=file:androidx/mediarouter/app/MediaRouteActionProvider.java+class:androidx.mediarouter.app.MediaRouteActionProvider)  
Added in[1.1.0](https://developer.android.com/jetpack/androidx/releases/mediarouter#1.1.0)

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/androidx/mediarouter/app/MediaRouteActionProvider "View this page in Java")

<br />

```
class MediaRouteActionProvider : ActionProvider
```

<br />

|---|---|-------------------------------------------------------------------------------------------------------------------------------------------------------|
| [kotlin.Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html)                                                                          |||
| ↳ | [androidx.core.view.ActionProvider](https://developer.android.com/reference/kotlin/androidx/core/view/ActionProvider)                                    ||
|   | ↳ | [androidx.mediarouter.app.MediaRouteActionProvider](https://developer.android.com/reference/kotlin/androidx/mediarouter/app/MediaRouteActionProvider) |

*** ** * ** ***

The media route action provider displays a[media route button](https://developer.android.com/reference/kotlin/androidx/mediarouter/app/MediaRouteButton)in the application's[ActionBar](https://developer.android.com/reference/kotlin/androidx/appcompat/app/ActionBar)to allow the user to select routes and to control the currently selected route.

The application must specify the kinds of routes that the user should be allowed to select by specifying a[selector](https://developer.android.com/reference/kotlin/androidx/mediarouter/media/MediaRouteSelector)with the[setRouteSelector](https://developer.android.com/reference/kotlin/androidx/mediarouter/app/MediaRouteActionProvider#setRouteSelector(androidx.mediarouter.media.MediaRouteSelector))method.

Refer to[MediaRouteButton](https://developer.android.com/reference/kotlin/androidx/mediarouter/app/MediaRouteButton)for a description of the button that will appear in the action bar menu.

### Prerequisites

To use the media route action provider, the activity must be a subclass of[AppCompatActivity](https://developer.android.com/reference/kotlin/androidx/appcompat/app/AppCompatActivity)from the`android.support.v7.appcompat`support library. Refer to support library documentation for details.

### Example

The application should define a menu resource to include the provider in the action bar options menu. Note that the support library action bar uses attributes that are defined in the application's resource namespace rather than the framework's resource namespace to configure each item.  

```kotlin
<menu xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:app="http://schemas.android.com/apk/res-auto">
    <item android:id="@+id/media_route_menu_item"
        android:title="@string/media_route_menu_title"
        app:showAsAction="always"
        app:actionProviderClass="androidx.mediarouter.app.MediaRouteActionProvider"/>
</menu>
```

Then configure the menu and set the route selector for the chooser.  

```kotlin
public class MyActivity extends AppCompatActivity {
    private MediaRouter mRouter;
    private MediaRouter.Callback mCallback;
    private MediaRouteSelector mSelector;

    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        mRouter = MediaRouter.getInstance(this);
        mSelector = new MediaRouteSelector.Builder()
                .addControlCategory(MediaControlIntent.CATEGORY_LIVE_AUDIO)
                .addControlCategory(MediaControlIntent.CATEGORY_REMOTE_PLAYBACK)
                .build();
        mCallback = new MyCallback();
    }

    // Add the callback on start to tell the media router what kinds of routes
    // the application is interested in so that it can try to discover suitable ones.
    public void onStart() {
        super.onStart();

        mediaRouter.addCallback(mSelector, mCallback,
                MediaRouter.CALLBACK_FLAG_REQUEST_DISCOVERY);

        MediaRouter.RouteInfo route = mediaRouter.updateSelectedRoute(mSelector);
        // do something with the route...
    }

    // Remove the callback flag CALLBACK_FLAG_REQUEST_DISCOVERY on stop by calling
    // addCallback() again in order to tell the media router that it no longer
    // needs to invest effort trying to discover routes of these kinds for now.
    public void onStop() {
        mRouter.addCallback(mSelector, mCallback, /* flags= */ 0);

        super.onStop();
    }

    // Remove the callback when the activity is destroyed.
    public void onDestroy() {
        mRouter.removeCallback(mCallback);

        super.onDestroy();
    }

    public boolean onCreateOptionsMenu(Menu menu) {
        super.onCreateOptionsMenu(menu);

        getMenuInflater().inflate(R.menu.sample_media_router_menu, menu);

        MenuItem mediaRouteMenuItem = menu.findItem(R.id.media_route_menu_item);
        MediaRouteActionProvider mediaRouteActionProvider =
                (MediaRouteActionProvider)MenuItemCompat.getActionProvider(mediaRouteMenuItem);
        mediaRouteActionProvider.setRouteSelector(mSelector);
        return true;
    }

    private final class MyCallback extends MediaRouter.Callback {
        // Implement callback methods as needed.
    }
}
```  

|                                                                                       See also                                                                                       |
|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| [setRouteSelector](https://developer.android.com/reference/kotlin/androidx/mediarouter/app/MediaRouteActionProvider#setRouteSelector(androidx.mediarouter.media.MediaRouteSelector)) |   |

## Summary

|                                                                                                                                          ### Public constructors                                                                                                                                          |
|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [MediaRouteActionProvider](https://developer.android.com/reference/kotlin/androidx/mediarouter/app/MediaRouteActionProvider#MediaRouteActionProvider(android.content.Context))`(context: `[Context](https://developer.android.com/reference/android/content/Context.html)`)` Creates the action provider. |

|                                                    ### Public functions                                                    |
|----------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)                                              | ~~[enableDynamicGroup](https://developer.android.com/reference/kotlin/androidx/mediarouter/app/MediaRouteActionProvider#enableDynamicGroup())~~`()` **This function is deprecated.** Use[setDialogType](https://developer.android.com/reference/kotlin/androidx/mediarouter/media/MediaRouterParams.Builder#setDialogType(int))with[DIALOG_TYPE_DYNAMIC_GROUP](https://developer.android.com/reference/kotlin/androidx/mediarouter/media/MediaRouterParams#DIALOG_TYPE_DYNAMIC_GROUP())instead. <br /> |
| [MediaRouteDialogFactory](https://developer.android.com/reference/kotlin/androidx/mediarouter/app/MediaRouteDialogFactory) | [getDialogFactory](https://developer.android.com/reference/kotlin/androidx/mediarouter/app/MediaRouteActionProvider#getDialogFactory())`()` Gets the media route dialog factory to use when showing the route chooser or controller dialog.                                                                                                                                                                                                                                                            |
| [MediaRouteButton](https://developer.android.com/reference/kotlin/androidx/mediarouter/app/MediaRouteButton)`?`            | [getMediaRouteButton](https://developer.android.com/reference/kotlin/androidx/mediarouter/app/MediaRouteActionProvider#getMediaRouteButton())`()` Gets the associated media route button, or null if it has not yet been created.                                                                                                                                                                                                                                                                      |
| [MediaRouteSelector](https://developer.android.com/reference/kotlin/androidx/mediarouter/media/MediaRouteSelector)         | [getRouteSelector](https://developer.android.com/reference/kotlin/androidx/mediarouter/app/MediaRouteActionProvider#getRouteSelector())`()` Gets the media route selector for filtering the routes that the user can select using the media route chooser dialog.                                                                                                                                                                                                                                      |
| [View](https://developer.android.com/reference/android/view/View.html)                                                     | [onCreateActionView](https://developer.android.com/reference/kotlin/androidx/mediarouter/app/MediaRouteActionProvider#onCreateActionView())`()` Factory method for creating new action views.                                                                                                                                                                                                                                                                                                          |
| [MediaRouteButton](https://developer.android.com/reference/kotlin/androidx/mediarouter/app/MediaRouteButton)               | [onCreateMediaRouteButton](https://developer.android.com/reference/kotlin/androidx/mediarouter/app/MediaRouteActionProvider#onCreateMediaRouteButton())`()` Called when the media route button is being created.                                                                                                                                                                                                                                                                                       |
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)                                        | [onPerformDefaultAction](https://developer.android.com/reference/kotlin/androidx/mediarouter/app/MediaRouteActionProvider#onPerformDefaultAction())`()` Performs an optional default action.                                                                                                                                                                                                                                                                                                           |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)                                              | ~~[setAlwaysVisible](https://developer.android.com/reference/kotlin/androidx/mediarouter/app/MediaRouteActionProvider#setAlwaysVisible(boolean))~~`(alwaysVisible: `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)`)` **This function is deprecated.** The visibility of the button is no longer controlled from[ActionProvider](https://developer.android.com/reference/kotlin/androidx/core/view/ActionProvider). <br />                                        |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)                                              | [setDialogFactory](https://developer.android.com/reference/kotlin/androidx/mediarouter/app/MediaRouteActionProvider#setDialogFactory(androidx.mediarouter.app.MediaRouteDialogFactory))`(factory: `[MediaRouteDialogFactory](https://developer.android.com/reference/kotlin/androidx/mediarouter/app/MediaRouteDialogFactory)`)` Sets the media route dialog factory to use when showing the route chooser or controller dialog.                                                                       |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)                                              | [setRouteSelector](https://developer.android.com/reference/kotlin/androidx/mediarouter/app/MediaRouteActionProvider#setRouteSelector(androidx.mediarouter.media.MediaRouteSelector))`(selector: `[MediaRouteSelector](https://developer.android.com/reference/kotlin/androidx/mediarouter/media/MediaRouteSelector)`)` Sets the media route selector for filtering the routes that the user can select using the media route chooser dialog.                                                           |

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       ### Inherited functions                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| From[androidx.core.view.ActionProvider](https://developer.android.com/reference/kotlin/androidx/core/view/ActionProvider) |-------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [Context](https://developer.android.com/reference/android/content/Context.html)     | [getContext](https://developer.android.com/reference/kotlin/androidx/core/view/ActionProvider#getContext())`()` Gets the context associated with this action provider.                                                                                                                                                                                                                                                                                                                   | | [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | [hasSubMenu](https://developer.android.com/reference/kotlin/androidx/core/view/ActionProvider#hasSubMenu())`()` Determines if this ActionProvider has a submenu associated with it.                                                                                                                                                                                                                                                                                                      | | [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | [isVisible](https://developer.android.com/reference/kotlin/androidx/core/view/ActionProvider#isVisible())`()` If[overridesItemVisibility](https://developer.android.com/reference/kotlin/androidx/core/view/ActionProvider#overridesItemVisibility())returns true, the return value of this method will help determine the visibility of the[MenuItem](https://developer.android.com/reference/android/view/MenuItem.html)this ActionProvider is bound to.                               | | [View](https://developer.android.com/reference/android/view/View.html)              | [onCreateActionView](https://developer.android.com/reference/kotlin/androidx/core/view/ActionProvider#onCreateActionView(android.view.MenuItem))`(forItem: `[MenuItem](https://developer.android.com/reference/android/view/MenuItem.html)`)` Factory method called by the Android framework to create new action views.                                                                                                                                                                 | | [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)       | [onPrepareSubMenu](https://developer.android.com/reference/kotlin/androidx/core/view/ActionProvider#onPrepareSubMenu(android.view.SubMenu))`(subMenu: `[SubMenu](https://developer.android.com/reference/android/view/SubMenu.html)`)` Called to prepare an associated submenu for the menu item backed by this ActionProvider.                                                                                                                                                          | | [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | [overridesItemVisibility](https://developer.android.com/reference/kotlin/androidx/core/view/ActionProvider#overridesItemVisibility())`()` The result of this method determines whether or not[isVisible](https://developer.android.com/reference/kotlin/androidx/core/view/ActionProvider#isVisible())will be used by the[MenuItem](https://developer.android.com/reference/android/view/MenuItem.html)this ActionProvider is bound to help determine its visibility.                    | | [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)       | [refreshVisibility](https://developer.android.com/reference/kotlin/androidx/core/view/ActionProvider#refreshVisibility())`()` If this ActionProvider is associated with an item in a menu, refresh the visibility of the item based on[overridesItemVisibility](https://developer.android.com/reference/kotlin/androidx/core/view/ActionProvider#overridesItemVisibility())and[isVisible](https://developer.android.com/reference/kotlin/androidx/core/view/ActionProvider#isVisible()). | | [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)       | [setVisibilityListener](https://developer.android.com/reference/kotlin/androidx/core/view/ActionProvider#setVisibilityListener(androidx.core.view.ActionProvider.VisibilityListener))`(listener: `[ActionProvider.VisibilityListener](https://developer.android.com/reference/kotlin/androidx/core/view/ActionProvider.VisibilityListener)`?)` Set a listener to be notified when this ActionProvider's overridden visibility changes.                                                   | |

## Public constructors

### MediaRouteActionProvider

Added in[1.1.0](https://developer.android.com/jetpack/androidx/releases/mediarouter#1.1.0)  

```
MediaRouteActionProvider(context: Context)
```

Creates the action provider.  

|                                         Parameters                                         |
|--------------------------------------------------------------------------------------------|--------------|
| `context: `[Context](https://developer.android.com/reference/android/content/Context.html) | The context. |

## Public functions

### enableDynamicGroup

Added in[1.1.0](https://developer.android.com/jetpack/androidx/releases/mediarouter#1.1.0)  
Deprecated in[1.2.0](https://developer.android.com/jetpack/androidx/releases/mediarouter#1.2.0)  

```
fun [enableDynamicGroup](https://developer.android.com/reference/kotlin/androidx/mediarouter/app/MediaRouteActionProvider#enableDynamicGroup())(): Unit
```
| **This function is deprecated.**   
|
| Use[setDialogType](https://developer.android.com/reference/kotlin/androidx/mediarouter/media/MediaRouterParams.Builder#setDialogType(int))with[DIALOG_TYPE_DYNAMIC_GROUP](https://developer.android.com/reference/kotlin/androidx/mediarouter/media/MediaRouterParams#DIALOG_TYPE_DYNAMIC_GROUP())instead.

Enables dynamic group feature. With this enabled, a different set of[MediaRouteChooserDialog](https://developer.android.com/reference/kotlin/androidx/mediarouter/app/MediaRouteChooserDialog)and[MediaRouteControllerDialog](https://developer.android.com/reference/kotlin/androidx/mediarouter/app/MediaRouteControllerDialog)is shown when the button is clicked. If a[media route provider](https://developer.android.com/reference/kotlin/androidx/mediarouter/media/MediaRouteProvider)supports dynamic group, the users can use that feature with the dialogs.  

|                                                                                  See also                                                                                  |
|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| [enableDynamicGroup](https://developer.android.com/reference/kotlin/androidx/mediarouter/app/MediaRouteButton#enableDynamicGroup())                                        |   |
| [MediaRouteProvider.DynamicGroupRouteController](https://developer.android.com/reference/kotlin/androidx/mediarouter/media/MediaRouteProvider.DynamicGroupRouteController) |   |

### getDialogFactory

Added in[1.1.0](https://developer.android.com/jetpack/androidx/releases/mediarouter#1.1.0)  

```
fun getDialogFactory(): MediaRouteDialogFactory
```

Gets the media route dialog factory to use when showing the route chooser or controller dialog.  

|                                                          Returns                                                           |
|----------------------------------------------------------------------------------------------------------------------------|---------------------------------|
| [MediaRouteDialogFactory](https://developer.android.com/reference/kotlin/androidx/mediarouter/app/MediaRouteDialogFactory) | The dialog factory, never null. |

### getMediaRouteButton

Added in[1.1.0](https://developer.android.com/jetpack/androidx/releases/mediarouter#1.1.0)  

```
fun getMediaRouteButton(): MediaRouteButton?
```

Gets the associated media route button, or null if it has not yet been created.  

### getRouteSelector

Added in[1.1.0](https://developer.android.com/jetpack/androidx/releases/mediarouter#1.1.0)  

```
fun getRouteSelector(): MediaRouteSelector
```

Gets the media route selector for filtering the routes that the user can select using the media route chooser dialog.  

|                                                      Returns                                                       |
|--------------------------------------------------------------------------------------------------------------------|---------------------------|
| [MediaRouteSelector](https://developer.android.com/reference/kotlin/androidx/mediarouter/media/MediaRouteSelector) | The selector, never null. |

### onCreateActionView

Added in[1.1.0](https://developer.android.com/jetpack/androidx/releases/mediarouter#1.1.0)  

```
fun onCreateActionView(): View
```

Factory method for creating new action views.  

|                                Returns                                 |
|------------------------------------------------------------------------|--------------------|
| [View](https://developer.android.com/reference/android/view/View.html) | A new action view. |

### onCreateMediaRouteButton

Added in[1.1.0](https://developer.android.com/jetpack/androidx/releases/mediarouter#1.1.0)  

```
fun onCreateMediaRouteButton(): MediaRouteButton
```

Called when the media route button is being created.

Subclasses may override this method to customize the button.  

### onPerformDefaultAction

```
fun onPerformDefaultAction(): Boolean
```

Performs an optional default action.

For the case of an action provider placed in a menu item not shown as an action this method is invoked if previous callbacks for processing menu selection has handled the event.

A menu item selection is processed in the following order:

- Receiving a call to[MenuItem.OnMenuItemClickListener.onMenuItemClick](https://developer.android.com/reference/android/view/MenuItem.OnMenuItemClickListener.html#onMenuItemClick(android.view.MenuItem)).
- Receiving a call to[onOptionsItemSelected](https://developer.android.com/reference/android/app/Activity.html#onOptionsItemSelected(android.view.MenuItem))FragmentActivity.onOptionsItemSelected(MenuItem)}
- Receiving a call to[onOptionsItemSelected](https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment#onOptionsItemSelected(android.view.MenuItem))Fragment.onOptionsItemSelected(MenuItem)}
- Launching the[android.content.Intent](https://developer.android.com/reference/android/content/Intent.html)set via[MenuItem.setIntent(android.content.Intent)](https://developer.android.com/reference/android/view/MenuItem.html#setIntent(android.content.Intent))
- Invoking this method.

The default implementation does not perform any action and returns false.  

### setAlwaysVisible

Added in[1.1.0](https://developer.android.com/jetpack/androidx/releases/mediarouter#1.1.0)  
Deprecated in[1.6.0](https://developer.android.com/jetpack/androidx/releases/mediarouter#1.6.0)  

```
fun [setAlwaysVisible](https://developer.android.com/reference/kotlin/androidx/mediarouter/app/MediaRouteActionProvider#setAlwaysVisible(boolean))(alwaysVisible: Boolean): Unit
```
| **This function is deprecated.**   
|
| The visibility of the button is no longer controlled from[ActionProvider](https://developer.android.com/reference/kotlin/androidx/core/view/ActionProvider).

Does nothing. You should not call this method.  

### setDialogFactory

Added in[1.1.0](https://developer.android.com/jetpack/androidx/releases/mediarouter#1.1.0)  

```
fun setDialogFactory(factory: MediaRouteDialogFactory): Unit
```

Sets the media route dialog factory to use when showing the route chooser or controller dialog.  

|                                                              Parameters                                                               |
|---------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------|
| `factory: `[MediaRouteDialogFactory](https://developer.android.com/reference/kotlin/androidx/mediarouter/app/MediaRouteDialogFactory) | The dialog factory, must not be null. |

### setRouteSelector

Added in[1.1.0](https://developer.android.com/jetpack/androidx/releases/mediarouter#1.1.0)  

```
fun setRouteSelector(selector: MediaRouteSelector): Unit
```

Sets the media route selector for filtering the routes that the user can select using the media route chooser dialog.  

|                                                           Parameters                                                           |
|--------------------------------------------------------------------------------------------------------------------------------|---------------------------------|
| `selector: `[MediaRouteSelector](https://developer.android.com/reference/kotlin/androidx/mediarouter/media/MediaRouteSelector) | The selector, must not be null. |