MediaSession.ConnectionResult.AcceptedResultBuilder


@UnstableApi
class MediaSession.ConnectionResult.AcceptedResultBuilder


A builder for ConnectionResult instances to accept a connection.

Summary

Public constructors

Creates an instance.

Public functions

MediaSession.ConnectionResult!

Returns a new ConnectionResult instance for accepting a connection.

MediaSession.ConnectionResult.AcceptedResultBuilder!

Sets the player commands that are available to the controller that gets this result returned when connecting.

MediaSession.ConnectionResult.AcceptedResultBuilder!

Sets the session commands that are available to the controller that gets this result returned when connecting.

MediaSession.ConnectionResult.AcceptedResultBuilder!

Sets the custom layout, overriding the custom layout of the session.

MediaSession.ConnectionResult.AcceptedResultBuilder!

Sets the session extras, overriding the extras of the session.

Public constructors

AcceptedResultBuilder

AcceptedResultBuilder(mediaSession: MediaSession!)

Creates an instance.

Parameters
mediaSession: MediaSession!

The session for which to create a ConnectionResult.

Public functions

build

fun build(): MediaSession.ConnectionResult!

Returns a new ConnectionResult instance for accepting a connection.

setAvailablePlayerCommands

@CanIgnoreReturnValue
fun setAvailablePlayerCommands(availablePlayerCommands: Player.Commands!): MediaSession.ConnectionResult.AcceptedResultBuilder!

Sets the player commands that are available to the controller that gets this result returned when connecting.

This set of available player commands is intersected with the actual player commands supported by a player. The resulting intersection is the set of commands actually being available to a controller.

The default is DEFAULT_PLAYER_COMMANDS.

setAvailableSessionCommands

@CanIgnoreReturnValue
fun setAvailableSessionCommands(availableSessionCommands: SessionCommands!): MediaSession.ConnectionResult.AcceptedResultBuilder!

Sets the session commands that are available to the controller that gets this result returned when connecting.

The default is DEFAULT_SESSION_AND_LIBRARY_COMMANDS for a MediaLibrarySession and DEFAULT_SESSION_COMMANDS for a MediaSession.

setCustomLayout

@CanIgnoreReturnValue
fun setCustomLayout(customLayout: (Mutable)List<CommandButton!>?): MediaSession.ConnectionResult.AcceptedResultBuilder!

Sets the custom layout, overriding the custom layout of the session.

The default is null to indicate that the custom layout of the session should be used.

Make sure to have the session commands of all command buttons of the custom layout included in the setAvailableSessionCommands available session commands}.

setSessionExtras

@CanIgnoreReturnValue
fun setSessionExtras(sessionExtras: Bundle!): MediaSession.ConnectionResult.AcceptedResultBuilder!

Sets the session extras, overriding the extras of the session.

The default is null to indicate that the extras of the session should be used.