Skip to content

Conversation

@arakneaweb
Copy link

This commit aim to use exoPlayer as a foreground service as recommanded here Create a basic media player app using Media3 ExoPlayer

This allow to automatically push notification when the screen turns off.

@arakneaweb arakneaweb closed this Nov 10, 2024
@arakneaweb arakneaweb reopened this Nov 11, 2024
ajustement de notation
release() there prevent the player to play once it has been previously stopped
This reverts commit 6bad221.
arakneaweb added a commit to arakneaweb/react-native-radio-player-akw that referenced this pull request Nov 11, 2024
release() there prevent the player to play once it has been previously stopped
@arakneaweb arakneaweb closed this Nov 11, 2024
@arakneaweb arakneaweb changed the title fix: #42 On Android : The app stops playing when the device turns to sleep mode fix: #72 On Android : The app stops playing when the device turns to sleep mode Nov 11, 2024
@arakneaweb arakneaweb reopened this Nov 11, 2024
release() there prevent the player to play once it has been previously stopped
@arakneaweb arakneaweb force-pushed the radio-player-foreground branch from 759f898 to 6c42691 Compare November 11, 2024 20:22
Copy link
Owner

@dehy dehy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for you contribution! I have some questions about the changes you made.

implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation "androidx.media3:media3-exoplayer:1.3.1"
implementation "androidx.media3:media3-exoplayer:1.4.1"
implementation "androidx.media3:media3-ui:1.4.1"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this lib may not be necessary as the UI is not used


private val context = reactContext
private var player: ExoPlayer = ExoPlayer.Builder(reactContext).build()
private var controller: MediaController? = null
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is a controller mandatory to manage the MediaSession?

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

Successfully merging this pull request may close these issues.

2 participants