Playback Overlap Issue When App Reloads

Hi everyone,

I’m building a music player app using ExoPlayer combined with a custom MediaNotification extension.

Problem:

When the app reloads (like reopening the screen or app regaining focus), and a song is already playing in the background, pressing a new play button causes overlapping audio — instead of pausing the previous one.


:test_tube: What I’ve Tried:

  1. :white_check_mark: Using a CallbackMusicPlayer block to handle:

    • "Play" → resumes ExoPlayer
    • "Pause" → pauses ExoPlayer
    • "Next", "Previous", etc.
  2. :white_check_mark: Created a custom procedure:

This allows me to simulate notification actions using logic, not taps.

  1. :white_check_mark: Tried using TinyDB to save playback state and song info

When I tap the Pause button on the notification manually, it works perfectly (pauses all sounds, even if overlapping).


:magnifying_glass_tilted_left: What I Need:

How can I auto-pause any ongoing background playback (from my own app’s ExoPlayer) when:

  • The screen initializes again
  • Or before a new song starts playing

Bonus: Is there a way to detect and control the currently playing instance without relying only on manual notification actions?

Any help or ideas would be greatly appreciated :folded_hands:

Hi, Ibrahim

Have you tried simply stopping the song before starting another one?

Yes i tried, it works ony if the app is active but if the app reloads (like reopening the screen or app regaining focus while another song is running) pressing a new play button causes overlapping audio — instead of pausing the previous one.

I guess with itools it possible just don’t know how to

If you completely close the app, does the audio stop?

Yes it stop

As the Notification Style extension is outdated anyway, you first should replace it by the Melon Notification extension before continuing with your issue

Taifun

@Taifun even if i replace it, i will still have the same problem, what i need most is that the app must listen to use click functions, eg after minimized it for 10 minute when user want to skip or play another it must stop the previous song, but if the screen reload it lost audio forcus which lead to cause overlaps

So first if its possible help me dealing with it then we go forward

How do you know without doing it?
It really does not make sense to try to fix an app which uses an outdated extension

Taifun

1 Like

Even with/without any notification extension this problem still occurs I don’t why you talk to me in this way

If there’s a solution just let me know how to make it, let me ask you @Taifun if I replace the extension will this issue be solved? 100% no so I don’t know where I replied wrongly

@RaYzZz I still waiting for you, any idea will be appreciated

But Taifun is right in pointing out that working with an outdated extension definitely doesn’t help.
You might find the solution, but with a non-functioning extension, you wouldn’t realize it’s actually working.

He didn’t mean it in a bad way.

I’m at work, I can’t always respond, as soon as I get home I’ll try doing some tests :flexed_biceps:.

1 Like

Oky @RaYzZz I understand

1 Like