MediaRouterParams


public class MediaRouterParams


MediaRouterParams are used in MediaRouter to denote routing functionality and UI types.

Summary

Nested types

public final class MediaRouterParams.Builder

Builder class for MediaRouterParams.

Constants

static final int

A dialog type used for default if not set.

static final int

A dialog type supporting dynamic group.

static final String
ENABLE_GROUP_VOLUME_UX = "androidx.mediarouter.media.MediaRouterParams.ENABLE_GROUP_VOLUME_UX"

Bundle key used for enabling group volume UX.

Public methods

int

Gets the media route controller dialog type.

boolean

Gets whether declared MediaTransferReceiver is enabled.

boolean

Gets whether the output switcher dialog is enabled.

boolean

Returns whether transferring media from remote to local is enabled.

Constants

DIALOG_TYPE_DEFAULT

Added in 1.2.0
public static final int DIALOG_TYPE_DEFAULT = 1

A dialog type used for default if not set. androidx.mediarouter.app.MediaRouteChooserDialog and androidx.mediarouter.app.MediaRouteControllerDialog will be shown

DIALOG_TYPE_DYNAMIC_GROUP

Added in 1.2.0
public static final int DIALOG_TYPE_DYNAMIC_GROUP = 2

A dialog type supporting dynamic group. Users can dynamically group and ungroup route devices via this type of route dialog when the selected routes are from a MediaRouteProvider that supports dynamic group.

ENABLE_GROUP_VOLUME_UX

Added in 1.3.0
public static final String ENABLE_GROUP_VOLUME_UX = "androidx.mediarouter.media.MediaRouterParams.ENABLE_GROUP_VOLUME_UX"

Bundle key used for enabling group volume UX. The default value is true. To disable the group volume UX, set the value false.

TYPE: boolean

Public methods

getDialogType

Added in 1.2.0
public int getDialogType()

Gets the media route controller dialog type.

See also
setDialogType

isMediaTransferReceiverEnabled

Added in 1.3.0
public boolean isMediaTransferReceiverEnabled()

Gets whether declared MediaTransferReceiver is enabled.

isOutputSwitcherEnabled

Added in 1.2.0
public boolean isOutputSwitcherEnabled()

Gets whether the output switcher dialog is enabled.

Note that it always returns false for Android versions earlier than Android R.

isTransferToLocalEnabled

Added in 1.2.0
public boolean isTransferToLocalEnabled()

Returns whether transferring media from remote to local is enabled.

Note that it always returns false for Android versions earlier than Android R.