MediaSession.ConnectionResult


class MediaSession.ConnectionResult


A result for onConnect to denote the set of available commands and the custom layout for a controller.

Summary

Nested types

A builder for ConnectionResult instances to accept a connection.

Public functions

java-static MediaSession.ConnectionResult!
accept(
    availableSessionCommands: SessionCommands!,
    availablePlayerCommands: Player.Commands!
)

Creates a connection result with the given session and player commands.

java-static MediaSession.ConnectionResult!

Creates a ConnectionResult to reject a connection.

Public properties

Player.Commands!

Available player commands.

SessionCommands!

Available session commands.

ImmutableList<CommandButton!>?

The custom layout or null if the custom layout of the session should be used.

Boolean

Whether the connection request is accepted or not.

Bundle?

The session extras.

Constants

DEFAULT_PLAYER_COMMANDS

@UnstableApi
const val DEFAULT_PLAYER_COMMANDSPlayer.Commands!

DEFAULT_SESSION_AND_LIBRARY_COMMANDS

@UnstableApi
const val DEFAULT_SESSION_AND_LIBRARY_COMMANDSSessionCommands!

DEFAULT_SESSION_COMMANDS

@UnstableApi
const val DEFAULT_SESSION_COMMANDSSessionCommands!

Public functions

accept

java-static fun accept(
    availableSessionCommands: SessionCommands!,
    availablePlayerCommands: Player.Commands!
): MediaSession.ConnectionResult!

Creates a connection result with the given session and player commands.

Commands are specific to the controller receiving this connection result.

The controller receives the custom layout of the session.

See AcceptedResultBuilder for a more flexible way to accept a connection.

reject

java-static fun reject(): MediaSession.ConnectionResult!

Creates a ConnectionResult to reject a connection.

Public properties

availablePlayerCommands

val availablePlayerCommandsPlayer.Commands!

Available player commands.

availableSessionCommands

val availableSessionCommandsSessionCommands!

Available session commands.

customLayout

@UnstableApi
val customLayoutImmutableList<CommandButton!>?

The custom layout or null if the custom layout of the session should be used.

isAccepted

val isAcceptedBoolean

Whether the connection request is accepted or not.

sessionExtras

@UnstableApi
val sessionExtrasBundle?

The session extras.