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

# pauseIfPlaying

`fun `[`MediaState`](../mozilla.components.feature.media.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#L68)

If this state is [MediaState.Playing](../mozilla.components.feature.media.state/-media-state/-playing/index.md) then pause all playing [Media](../mozilla.components.concept.engine.media/-media/index.md).

