NewPlayerUIState

data class NewPlayerUIState(val uiMode: UIModeState, val playing: Boolean, val contentRatio: Float, val embeddedUiRatio: Float, val contentFitMode: ContentScale, val seekerPosition: Float, val bufferedPercentage: Float, val isLoading: Boolean, val durationInMs: Long, val playbackPositionInMs: Long, val playbackPositionInPlaylistMs: Long, val fastSeekSeconds: Int, val soundVolume: Float, val brightness: Float?, val embeddedUiConfig: EmbeddedUiConfig?, val playList: List<MediaItem>, val chapters: List<Chapter>, val shuffleEnabled: Boolean, val repeatMode: RepeatMode, val playListDurationInS: Int, val currentlyPlaying: MediaItem?, val currentPlaylistItemIndex: Int, val currentlyAvailableTracks: List<StreamTrack>, val currentlyPlayingTracks: List<StreamTrack>, val enteringPip: Boolean, val currentSeekPreviewThumbnail: ImageBitmap?, val seekPreviewVisible: Boolean)

Shows the state the UI is rendering. In the manner of MVVM, NewPlayerViewModel sends this state over to NewPlayerUI, to tell it what should be rendered.

Constructors

Link copied to clipboard
constructor(uiMode: UIModeState, playing: Boolean, contentRatio: Float, embeddedUiRatio: Float, contentFitMode: ContentScale, seekerPosition: Float, bufferedPercentage: Float, isLoading: Boolean, durationInMs: Long, playbackPositionInMs: Long, playbackPositionInPlaylistMs: Long, fastSeekSeconds: Int, soundVolume: Float, brightness: Float?, embeddedUiConfig: EmbeddedUiConfig?, playList: List<MediaItem>, chapters: List<Chapter>, shuffleEnabled: Boolean, repeatMode: RepeatMode, playListDurationInS: Int, currentlyPlaying: MediaItem?, currentPlaylistItemIndex: Int, currentlyAvailableTracks: List<StreamTrack>, currentlyPlayingTracks: List<StreamTrack>, enteringPip: Boolean, currentSeekPreviewThumbnail: ImageBitmap?, seekPreviewVisible: Boolean)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

The brightness volume. Might be null if the system is in control of the brightness.

Link copied to clipboard

The amount of buffered video/audio material, Whereas bufferedPercentage ∈ 0; 1.

Link copied to clipboard

The chapters provided by the currently playing item. Might be empty if the item does not have chapters or when the chapter didn't load up yet.

Link copied to clipboard

Depicts weather the video should fit inside, be cropped or stretched.

Link copied to clipboard

The content ratio of the currently playing video.

Link copied to clipboard

The tracks that are available for the currently playing item.

Link copied to clipboard

The media item that is currently playing.

Link copied to clipboard

The tracks that are currently playing. in other words these tracks are actively playing back and are getting muxed together by ExoPlayer.

Link copied to clipboard

The index into the playList, that depicts the currently playing item.

Link copied to clipboard

The seeker preview thumbnail that should be visible. This updates if the user uses the seeker thumb to seek through a stream. If null no thumbnail is available.

Link copied to clipboard

The duration of the currently playing stream in milliseconds.

Link copied to clipboard

This is used to restore several values when switching back from a fullscreen view to an embedded screen view. Such values include the color scheme of the system info bar, the screen brightness and the default screen orientation.

Link copied to clipboard

The ratio of the embedded UI. This might differ from the content ratio.

Link copied to clipboard

Is the Ui currently transitioning to PiP mode.

Link copied to clipboard

Amount of seconds on step of fast seek can take.

Link copied to clipboard

The same as ExoPlayers isLoading. See Player.isLoading

Link copied to clipboard

The playback position of the currently playing stream in milliseconds. This only updates if the progress updater job runs within NewPlayerViewModel.

Link copied to clipboard

The playback position within the whole currently playing playlist.

Link copied to clipboard

Is the stream currently playing or not.

Link copied to clipboard

The currently playing playlist as provided by ExoPlayer. However, it might sometimes drift from the playlist provided by exoplayer. This can happen when the user reorders items. The playlist will then immediately reflect the new state of the list, even though that state was not yet confirmed by exoplayer. If this list could not drift you would expect the UI to be jittery upon item reordering.

Link copied to clipboard

Duration of the whole currently playing playlist

Link copied to clipboard
Link copied to clipboard

The position of the seeker thumb. Whereas seekerPosition ∈ 0; 1.

Link copied to clipboard

Depicts weather the seeker preview thumbnail should be visible or not.

Link copied to clipboard
Link copied to clipboard

The current sound volume.

Link copied to clipboard

Depicts which screen of NewPlayer's UI should be visible.