Exoplayer about 10 or 15 minutes the application closes when the screen turns off

Tomorrow I try it on android 10 and I inform you. Although I don’t have much hope for the truth. In this thread a possible solution is given:

and here is an exoplayer library, the notifier in foreground:

https://exoplayer.dev/doc/reference/com/google/android/exoplayer2/ui/PlayerNotificationManager.html

I don’t think we can do something to fix it, unless Kodular fix it…

Yes, I’m curious, so please let me know.

But I read this:

grafik

2 Likes

I tried it on Nexus 5X with Android 10 and it ends up kill the app too…
What version of exoplayer is kodular currently using?

I asked this question a long time ago:

2 Likes

I checked it again on my Nexus 5X running Android 9:
no issues at all.

1 Like

Did you root your device for that?

I’ve tried it in the android studio AVD.

1 Like

I have tried this notification extension by @Ken:

I’ve tried it on AVD Pixel 3 Android 9 and on Physical Smartphone with Android 6. I’ve been listening to music for more than 40 minutes without closing. I have closed.
I put here the .aia and .apk file.
ExoTest.aia (494.1 KB)
ExoTest.apk (5.8 MB)

For this test I have not removed the notifier from the status bar. Tomorrow I will try removing the notification from the status bar. Let’s see what happens.

I checked your application out of curiosity

Huawei P20 Android 9 - negative test.
Huawei P30 Android 9 - negative test.
Huawei P30 Android 10 - negative test.
Huawei P30 Pro Android 9 - negative test.
Huawei P30 Pro Android 10 - negative test.
Huawei Nova 5 Android 9 - negative test.

I don’t have more phones to test now

1 Like

This extension only provides a notification it doesn’t affect audio in any way.

1 Like

Was your device plugged into a charger?

Negative test Does it mean that the app closes or stops sound?

No, I was not charger, in my tests, the problem happens within a few minutes that it closes or the system kills the app. I curiously tried the extension just in case. and I was listening until I decided to stop the test.

YES that means

1 Like

On my Samsung Galaxy S8 running android OS v9.0:
If I allow/force the screen to turn off the audio stops after a couple of minutes but if I turn the screen back on, the audio resumes.

1 Like

It must be different problems, my physical device is not modern, it has android 6. And the devices emulated in android studio always have 100% battery. Maybe if you add partial_wakelock permission to manifest to try on this apk?

PARTIAL_WAKE_LOCK requires more than just the permission.
That being said, I created a PARTIAL_WAKE_LOCK extension for this and it didn’t help.

1 Like

I checked your APK:
The same results as before. After about 50-60 sec the sound begins to stutter or stops (depending if only 1 or 2 ExoPlayer are played. Tested on a Galaxy Note8 (Android 9).

Steps to reproduce:

  1. open App
  2. click “Play” or “Play2”
  3. turn of the screen by pressing the power button (standby, sleep mode, black screen)
  4. wait 50-60 sec: sound begins to stutter or after pressed “Play2” (at step 2): sounds stop

The same result seems to occur on a Galaxy S8 (Android 9) as @Ken told in PM.

2 Likes

my solution ( temporary ) as i used:

1 Like

It’s really work for you? @80man