[android-components](../index.md) / [mozilla.components.feature.media.ext](./index.md)

## Package mozilla.components.feature.media.ext

### Functions

| Name | Summary |
|---|---|
| [findPlayingSession](find-playing-session.md) | `fun `[`MediaState`](../mozilla.components.browser.state.state/-media-state/index.md)`.findPlayingSession(): `[`Pair`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-pair/index.html)`<`[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`, `[`List`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html)`<`[`Element`](../mozilla.components.browser.state.state/-media-state/-element/index.md)`>>?`<br>Find a [SessionState](../mozilla.components.browser.state.state/-session-state/index.md) with playing [Media](../mozilla.components.concept.engine.media/-media/index.md) and return this [Pair](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-pair/index.html) or `null` if no such [SessionState](../mozilla.components.browser.state.state/-session-state/index.md) could be found. |
| [getActiveElements](get-active-elements.md) | `fun `[`MediaState`](../mozilla.components.browser.state.state/-media-state/index.md)`.getActiveElements(): `[`List`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html)`<`[`Element`](../mozilla.components.browser.state.state/-media-state/-element/index.md)`>`<br>Returns the list of active [MediaState.Element](../mozilla.components.browser.state.state/-media-state/-element/index.md)s. |
| [getActiveMediaTab](get-active-media-tab.md) | `fun `[`BrowserState`](../mozilla.components.browser.state.state/-browser-state/index.md)`.getActiveMediaTab(): `[`SessionState`](../mozilla.components.browser.state.state/-session-state/index.md)`?`<br>Get the [SessionState](../mozilla.components.browser.state.state/-session-state/index.md) that caused this [MediaState](../mozilla.components.browser.state.state/-media-state/index.md) (if any). |
| [getPausedMedia](get-paused-media.md) | `fun `[`MediaState`](../mozilla.components.browser.state.state/-media-state/index.md)`.getPausedMedia(tabId: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`?): `[`List`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html)`<`[`Element`](../mozilla.components.browser.state.state/-media-state/-element/index.md)`>`<br>Get the list of paused [Media](../mozilla.components.concept.engine.media/-media/index.md) for the tab with the provided [tabId](get-paused-media.md#mozilla.components.feature.media.ext$getPausedMedia(mozilla.components.browser.state.state.MediaState, kotlin.String)/tabId). |
| [getPlayingMediaIdsForTab](get-playing-media-ids-for-tab.md) | `fun `[`MediaState`](../mozilla.components.browser.state.state/-media-state/index.md)`.getPlayingMediaIdsForTab(tabId: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`?): `[`List`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html)`<`[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`>`<br>Returns a list of [MediaState.Element.id](../mozilla.components.browser.state.state/-media-state/-element/id.md) of playing media on the tab with the given [tabId](get-playing-media-ids-for-tab.md#mozilla.components.feature.media.ext$getPlayingMediaIdsForTab(mozilla.components.browser.state.state.MediaState, kotlin.String)/tabId). |
| [pauseIfPlaying](pause-if-playing.md) | `fun `[`MediaState`](../mozilla.components.browser.state.state/-media-state/index.md)`.pauseIfPlaying(): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)<br>If this state is [MediaState.State.PLAYING](../mozilla.components.browser.state.state/-media-state/-state/-p-l-a-y-i-n-g.md) then pause all playing [Media](../mozilla.components.concept.engine.media/-media/index.md). |
| [playIfPaused](play-if-paused.md) | `fun `[`MediaState`](../mozilla.components.browser.state.state/-media-state/index.md)`.playIfPaused(): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)<br>If this state is [MediaState.State.PAUSED](../mozilla.components.browser.state.state/-media-state/-state/-p-a-u-s-e-d.md) then resume playing all paused [Media](../mozilla.components.concept.engine.media/-media/index.md). |
| [playing](playing.md) | `fun `[`MediaState`](../mozilla.components.browser.state.state/-media-state/index.md)`.playing(): `[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)<br>If this state is [MediaState.State.PLAYING](../mozilla.components.browser.state.state/-media-state/-state/-p-l-a-y-i-n-g.md) then return true, else return false. |
