update exoplayer to 2.14.0 #40

Closed
opened 1 year ago by Seil0 · 1 comments
Seil0 commented 1 year ago
Owner
* investigate PlayerNotificationManager * https://medium.com/google-exoplayer/playback-notifications-with-exoplayer-a2f1a18cf93b * https://exoplayer.dev/doc/reference/com/google/android/exoplayer2/ui/PlayerNotificationManager.html
Seil0 added the
dependency
label 1 year ago
Seil0 added this to the 0.4.2 milestone 1 year ago
Poster
Owner

For the time being teapod will not sow a media notification as other streaming apps and media players don't show one either. Below is working prototype code for notifications using the PlayerNotificationManager.

 var playerNotificationManager = PlayerNotificationManager
     .Builder(application, 1, "player", DescriptionAdapter()).build()

// Create the NotificationChannel
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
     val name = "Test Name"
     val descriptionText = "Test Description2"
     val importance = NotificationManager.IMPORTANCE_LOW
     val mChannel = NotificationChannel("player", name, importance)
     mChannel.description = descriptionText
     // Register the channel with the system; you can't change the importance
     // or other notification behaviors after this
     val notificationManager = application
         .getSystemService(NOTIFICATION_SERVICE) as NotificationManager
     notificationManager.createNotificationChannel(mChannel)
}

playerNotificationManager.setMediaSessionToken(mediaSession.sessionToken)
playerNotificationManager.setPlayer(player)

For the time being teapod will not sow a media notification as other streaming apps and media players don't show one either. Below is working prototype code for notifications using the PlayerNotificationManager. ```kotlin var playerNotificationManager = PlayerNotificationManager .Builder(application, 1, "player", DescriptionAdapter()).build() // Create the NotificationChannel if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { val name = "Test Name" val descriptionText = "Test Description2" val importance = NotificationManager.IMPORTANCE_LOW val mChannel = NotificationChannel("player", name, importance) mChannel.description = descriptionText // Register the channel with the system; you can't change the importance // or other notification behaviors after this val notificationManager = application .getSystemService(NOTIFICATION_SERVICE) as NotificationManager notificationManager.createNotificationChannel(mChannel) } playerNotificationManager.setMediaSessionToken(mediaSession.sessionToken) playerNotificationManager.setPlayer(player) ```
Seil0 closed this issue 1 year ago
Sign in to join this conversation.
Loading…
There is no content yet.

Du besuchst diese Seite mit einem veralteten IPv4-Internetzugang. Möglicherweise treten in Zukunft Probleme mit der Erreichbarkeit und Performance auf. Bitte frage deinen Internetanbieter oder Netzwerkadministrator nach IPv6-Unterstützung.
You are visiting this site with an outdated IPv4 internet access. You may experience problems with accessibility and performance in the future. Please ask your ISP or network administrator for IPv6 support.
Weitere Infos | More Information
Klicke zum schließen | Click to close