android-components / mozilla.components.feature.media.state / MediaState

MediaState

sealed class MediaState (source)

Accumulated state of all Media of all Sessions.

Types

Name Summary
None object None : MediaState
None: No media state.
Paused data class Paused : MediaState
Paused: media of session is currently paused.
Playing data class Playing : MediaState
Playing: media of session is currently playing.

Extension Functions

Name Summary
getSession fun MediaState.getSession(): Session?
Get the Session that caused this MediaState (if any).
isForCustomTabSession fun MediaState.isForCustomTabSession(): Boolean
Returns true if this MediaState is associated with a Custom Tab Session.
loadResourceAsString fun Any.loadResourceAsString(path: String): String
Loads a file from the resources folder and returns its content as a string object.
pauseIfPlaying fun MediaState.pauseIfPlaying(): Unit
If this state is MediaState.Playing then pause all playing Media.
playIfPaused fun MediaState.playIfPaused(): Unit
If this state is MediaState.Paused then resume playing all paused Media.

Inheritors

Name Summary
None object None : MediaState
None: No media state.
Paused data class Paused : MediaState
Paused: media of session is currently paused.
Playing data class Playing : MediaState
Playing: media of session is currently playing.