[android-components](../index.md) / [mozilla.components.feature.media.ext](index.md) / [pauseIfPlaying](./pause-if-playing.md)

# pauseIfPlaying

`fun `[`MediaState`](../mozilla.components.browser.state.state/-media-state/index.md)`.pauseIfPlaying(): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) [(source)](https://github.com/mozilla-mobile/android-components/blob/master/components/feature/media/src/main/java/mozilla/components/feature/media/ext/MediaState.kt#L134)

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).

