How to pause other player when starting bitmovin


I’m trying to add a feature that I’ve seen , when a music is already playing in background by another app and the user starts my app

I’ve looked into your documentation but couldn’t find anything. How to do this with Bitmovin ?

Thanks !

Hello @obadia.yoni, welcome to the community.

The behaviour can be achieved by requesting the system’s audio focus. See this article in the Android Developers guide.

We are currently gauging interest for this feature as part of our Android Player SDK to make the integration easier. We will keep you updated about any progress.

Best, Lukas

Yes I have found out how to do it with ExoPlayer, which is really simple

val audioAttributes = AudioAttributes.Builder()

ExoPlayer.Builder(context).setAudioAttributes(audioAttributes, true).build()

Having such function exposed in Bitmovin would be much easier and simpler to implement this feature

Example showing implementation with AudioFocus: bitmovin-player-android-samples/BasicMediaControlKotlin/src/main/java/com/bitmovin/player/samples/mediacontrol/basic/MainActivity.kt at 0029e426b6402ab3e8bc847d4335061cd840fb04 · bitmovin/bitmovin-player-android-samples · GitHub