PlaylistApi

interface PlaylistApi

Provides the means to manage multiple Sources inside a playback session.

When the player transitions from one source in the playback session to another (either by normal playback or by seeking), a PlayerEvent.PlaylistTransition event is emitted and the new source becomes active while the old one becomes inactive.

Accessible through Player.playlist.

Functions

Link copied to clipboard
abstract fun add(source: Source)

Appends the source to the active playback session.

abstract fun add(source: Source, index: Int)

Adds the source to the active playback session at index.

Link copied to clipboard
abstract fun remove(source: Source)

Removes the source from the active playback session. Trying to remove the active source has no effect and will result in a no-op.

abstract fun remove(index: Int)

Removes the source at index from the active playback session. Trying to remove the active source has no effect and will result in a no-op.

Link copied to clipboard
abstract fun seek(source: Source, time: Double)

Seeks to the specified time in the specified source. The source must be part of the playback session.

Properties

Link copied to clipboard
abstract val sources: List<Source>

The list of Sources currently in the playback session. Exactly one source is always active in a playback session.