From d2e4a056e2d80746c36c5296749f167689cc347a Mon Sep 17 00:00:00 2001 From: Jesse Date: Mon, 17 Oct 2022 12:15:47 +0200 Subject: [PATCH] Fix: Set PlayerNotificationManager up correctly --- .../Android/MediaSession/MediaBrowserService.cs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/MediaManager/Platforms/Android/MediaSession/MediaBrowserService.cs b/MediaManager/Platforms/Android/MediaSession/MediaBrowserService.cs index 6749622c..2bea52ab 100644 --- a/MediaManager/Platforms/Android/MediaSession/MediaBrowserService.cs +++ b/MediaManager/Platforms/Android/MediaSession/MediaBrowserService.cs @@ -103,8 +103,10 @@ protected virtual void PrepareNotificationManager() PlayerNotificationManager = new Com.Google.Android.Exoplayer2.UI.PlayerNotificationManager.Builder( this, ForegroundNotificationId, - ChannelId, - MediaDescriptionAdapter).Build(); + ChannelId) + .SetMediaDescriptionAdapter(MediaDescriptionAdapter) + .SetNotificationListener(NotificationListener) + .Build(); //Needed for enabling the notification as a mediabrowser. NotificationListener = new NotificationListener(); @@ -129,9 +131,6 @@ protected virtual void PrepareNotificationManager() //PlayerNotificationManager.SetFastForwardIncrementMs((long)MediaManager.StepSizeForward.TotalMilliseconds); //PlayerNotificationManager.SetRewindIncrementMs((long)MediaManager.StepSizeBackward.TotalMilliseconds); - //TODO: not sure why this is broken? Maybe in the binding - //PlayerNotificationManager.SetNotificationListener(NotificationListener); - PlayerNotificationManager.SetMediaSessionToken(SessionToken); //PlayerNotificationManager.SetOngoing(true); PlayerNotificationManager.SetUsePlayPauseActions(MediaManager.Notification.ShowPlayPauseControls);