update exoplayer to 2.14.0 #40

Closed
opened 2021-05-16 22:20:13 +02:00 by Seil0 · 1 comment
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 2021-05-16 22:20:13 +02:00
Seil0 added this to the 0.4.2 milestone 2021-05-27 23:07:51 +02:00
Author
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 2021-06-17 19:36:41 +02:00
Sign in to join this conversation.
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: Seil0/teapod#40
No description provided.