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

Home / Uncategorized / Android: ExoPlayer – Audio stream playing in one app stops when exoplayer instance is initialised in another app

Question:
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.


Answer:
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.
Read more

Leave a Reply

Your email address will not be published. Required fields are marked *