MediaPlaybackCommands

interface MediaPlaybackCommands

Known direct subclasses
MediaPlayback

API for the MediaPlayback trait.


Summary

Public functions

suspend Unit
activateAudioTrack(trackId: String, audioOutputIndex: UByte)
suspend Unit
suspend Unit
suspend MediaPlaybackTrait.FastForwardCommand.Response

Fast forward the current media.

suspend MediaPlaybackTrait.NextCommand.Response

Move to the next item in the media.

suspend MediaPlaybackTrait.PauseCommand.Response

Pause the current media.

suspend MediaPlaybackTrait.PlayCommand.Response

Play the current media.

suspend MediaPlaybackTrait.PreviousCommand.Response

Move to the previous item in the current media.

suspend MediaPlaybackTrait.RewindCommand.Response

Rewind the current media.

suspend MediaPlaybackTrait.SeekCommand.Response
seek(position: ULong)

Change the playback position in the current media to the specified position.

suspend MediaPlaybackTrait.SkipBackwardCommand.Response
skipBackward(deltaPositionMilliseconds: ULong)

Skip backward by a specified amount of time within the current media.

suspend MediaPlaybackTrait.SkipForwardCommand.Response
skipForward(deltaPositionMilliseconds: ULong)

Skip forward by a specified amount of time within the current media.

suspend MediaPlaybackTrait.StartOverCommand.Response

Start over from the beginning of the current media.

suspend MediaPlaybackTrait.StopCommand.Response

Stop playing the current media.

Public functions

activateAudioTrack

suspend fun activateAudioTrack(trackId: String, audioOutputIndex: UByte): Unit

activateTextTrack

suspend fun activateTextTrack(trackId: String): Unit

deactivateTextTrack

suspend fun deactivateTextTrack(): Unit

fastForward

suspend fun fastForward(optionalArgs: MediaPlaybackTrait.FastForwardCommand.OptionalArgs.() -> Unit = {}): MediaPlaybackTrait.FastForwardCommand.Response

Fast forward the current media.

Parameters
optionalArgs: MediaPlaybackTrait.FastForwardCommand.OptionalArgs.() -> Unit = {}

Receiver for the optional arguments of this command

Returns
MediaPlaybackTrait.FastForwardCommand.Response

The outcome of the FastForward command.

next

suspend fun next(): MediaPlaybackTrait.NextCommand.Response

Move to the next item in the media.

Returns
MediaPlaybackTrait.NextCommand.Response

The outcome of the Next command.

pause

suspend fun pause(): MediaPlaybackTrait.PauseCommand.Response

Pause the current media.

Returns
MediaPlaybackTrait.PauseCommand.Response

The outcome of the Pause command.

play

suspend fun play(): MediaPlaybackTrait.PlayCommand.Response

Play the current media.

Returns
MediaPlaybackTrait.PlayCommand.Response

The outcome of the Play command.

previous

suspend fun previous(): MediaPlaybackTrait.PreviousCommand.Response

Move to the previous item in the current media.

Returns
MediaPlaybackTrait.PreviousCommand.Response

The outcome of the Previous command.

rewind

suspend fun rewind(optionalArgs: MediaPlaybackTrait.RewindCommand.OptionalArgs.() -> Unit = {}): MediaPlaybackTrait.RewindCommand.Response

Rewind the current media.

Parameters
optionalArgs: MediaPlaybackTrait.RewindCommand.OptionalArgs.() -> Unit = {}

Receiver for the optional arguments of this command

Returns
MediaPlaybackTrait.RewindCommand.Response

The outcome of the Rewind command.

seek

suspend fun seek(position: ULong): MediaPlaybackTrait.SeekCommand.Response

Change the playback position in the current media to the specified position.

Parameters
position: ULong

The position to seek to, relative to the start of the media, in milliseconds.

Returns
MediaPlaybackTrait.SeekCommand.Response

The outcome of the Seek command.

skipBackward

suspend fun skipBackward(deltaPositionMilliseconds: ULong): MediaPlaybackTrait.SkipBackwardCommand.Response

Skip backward by a specified amount of time within the current media.

Parameters
deltaPositionMilliseconds: ULong

The duration of the time span to skip backward in the media, in milliseconds.

Returns
MediaPlaybackTrait.SkipBackwardCommand.Response

The outcome of the SkipBackward command.

skipForward

suspend fun skipForward(deltaPositionMilliseconds: ULong): MediaPlaybackTrait.SkipForwardCommand.Response

Skip forward by a specified amount of time within the current media.

Parameters
deltaPositionMilliseconds: ULong

The duration of the time span to skip forward in the media, in milliseconds.

Returns
MediaPlaybackTrait.SkipForwardCommand.Response

The outcome of the SkipForward command.

startOver

suspend fun startOver(): MediaPlaybackTrait.StartOverCommand.Response

Start over from the beginning of the current media.

Returns
MediaPlaybackTrait.StartOverCommand.Response

The outcome of the StartOver command.

stop

suspend fun stop(): MediaPlaybackTrait.StopCommand.Response

Stop playing the current media.

Returns
MediaPlaybackTrait.StopCommand.Response

The outcome of the Stop command.