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

MediaStateMachine

object MediaStateMachine : Observable<Observer> (source)

A state machine that subscribes to all Session instances and watches changes to their Media to create an aggregated MediaState.

Other components can subscribe to the state machine to get notified about MediaState changes.

Types

Name Summary
Observer interface Observer
Interface for observers that are interested in MediaState changes.

Properties

Name Summary
state var state: MediaState
The current MediaState.

Functions

Name Summary
reset fun reset(): Unit
Resets the MediaState to MediaState.None.
start fun start(sessionManager: SessionManager): Unit
Start observing Session and their Media and create an aggregated MediaState that can be observed.
stop fun stop(): Unit
Stop observing Session and their Media.

Extension Functions

Name Summary
loadResourceAsString fun Any.loadResourceAsString(path: String): String
Loads a file from the resources folder and returns its content as a string object.