Android: ExoPlayer - Audio stream playing in one app stops when exoplayer instance is initialised in another app

624 views Asked by At

There are two apps using Exoplayer. AppA and AppB

  • AppA starts streaming audio.
  • AppB is then launched which initialises the exoplayer instance. NOTE: No stream is yet played on AppB.
  • But right away AppA stops playing the audio.

Could someone help understand this behaviour with the new initialisation of the exoplayer?

Thanks.

2

There are 2 answers

0
Sunny On BEST ANSWER

The issue was that we were requesting for audio focus after initialisation instead of when the user requested a play event. Basic mistake I suppose.

No issue in terms of the ExoPlayer.

0
Sever On

Probably ExoPlayer gets garbage collected. You should use foreground service, to make sure a service stays alive as much as possible without being killed by the system.