android-components / mozilla.components.feature.media.ext

Package mozilla.components.feature.media.ext

Functions

Name Summary
findPlayingSession fun MediaState.findPlayingSession(): Pair<String, List<Element>>?
Find a SessionState with playing Media and return this Pair or null if no such SessionState could be found.
getActiveElements fun MediaState.getActiveElements(): List<Element>
Returns the list of active MediaState.Elements.
getActiveMediaTab fun BrowserState.getActiveMediaTab(): SessionState?
Get the SessionState that caused this MediaState (if any).
getPausedMedia fun MediaState.getPausedMedia(tabId: String?): List<Element>
Get the list of paused Media for the tab with the provided tabId.
getPlayingMediaIdsForTab fun MediaState.getPlayingMediaIdsForTab(tabId: String?): List<String>
Returns a list of MediaState.Element.id of playing media on the tab with the given tabId.
pauseIfPlaying fun MediaState.pauseIfPlaying(): Unit
If this state is MediaState.State.PLAYING then pause all playing Media.
playIfPaused fun MediaState.playIfPaused(): Unit
If this state is MediaState.State.PAUSED then resume playing all paused Media.