Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android : The app stops playing when the device turns to sleep mode #72

Open
arakneaweb opened this issue Sep 10, 2024 · 0 comments
Open

Comments

@arakneaweb
Copy link

arakneaweb commented Sep 10, 2024

Hello there !
First of all thank you very much for this very cool component.
I just got a problem : when the phone turns into sleep mode, the app stops playing.
I put the right permission with wake_lock in app.json

"android": {
      "permissions": [
        "android.permission.WAKE_LOCK"
      ],
    },

and find it well in AndroidManifest.xml
<uses-permission android:name="android.permission.WAKE_LOCK"/>

I found out you're using ExoPlayer.setWakeMode nicely and found out the following here :
Enabling this feature requires the WAKE_LOCK permission. It should be used together with a foreground android.app.Service for use cases where playback occurs and the screen is off (e.g. background audio playback).

But as I'm checking for the services I feel like I'm heading towards a complex "solution" and may be missing something very simple. Especially as in here they say :

  • If you're playing audio, the audio system sets and manages a wake lock for you; you don't need to do it yourself.

  • If you're using Media3 ExoPlayer, you can use ExoPlayer.setWakeMode() to have the player set a wake lock for you.

It's my first mobile app so thanks a lot for your help :)

arakneaweb added a commit to arakneaweb/react-native-radio-player-akw that referenced this issue Nov 10, 2024
arakneaweb added a commit to arakneaweb/react-native-radio-player-akw that referenced this issue Nov 11, 2024
ajustement de notation
arakneaweb added a commit to arakneaweb/react-native-radio-player-akw that referenced this issue Nov 11, 2024
release() there prevent the player to play once it has been previously stopped
arakneaweb added a commit to arakneaweb/react-native-radio-player-akw that referenced this issue Nov 11, 2024
This reverts commit 6bad221.
arakneaweb added a commit to arakneaweb/react-native-radio-player-akw that referenced this issue Nov 11, 2024
release() there prevent the player to play once it has been previously stopped
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant