How to pause other player when starting bitmovin

Hello,

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()
    .setUsage(C.USAGE_MEDIA)
    .setContentType(C.AUDIO_CONTENT_TYPE_MOVIE)
    .build()

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

1 Like

I am happy to announce that since version 3.60.0 the Bitmovin Player has full out-of-the-box audio focus handling capabilities. :tada:

This topic was automatically closed 60 minutes after the last reply. New replies are no longer allowed.