From ef7033951f7f32a50f68463cf8d4bfb7b6a5ce69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andri=20Kr=C3=A4mer?= Date: Fri, 25 Oct 2024 15:47:08 +0200 Subject: [PATCH] swapped lines as described in https://github.com/Baseflow/XamarinMediaManager/issues/900 --- .../MediaSession/MediaBrowserService.cs | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/MediaManager/Platforms/Android/MediaSession/MediaBrowserService.cs b/MediaManager/Platforms/Android/MediaSession/MediaBrowserService.cs index 7cc96893..bef5a5aa 100644 --- a/MediaManager/Platforms/Android/MediaSession/MediaBrowserService.cs +++ b/MediaManager/Platforms/Android/MediaSession/MediaBrowserService.cs @@ -115,15 +115,7 @@ protected virtual void PrepareNotificationManager() // nm.CreateNotificationChannel(channel); //} - PlayerNotificationManager = new Com.Google.Android.Exoplayer2.UI.PlayerNotificationManager.Builder( - this, - ForegroundNotificationId, - ChannelId) - .SetChannelNameResourceId(Resource.String.XamarinMediaManagerName) - .SetChannelDescriptionResourceId(Resource.String.XamarinMediaManagerDescription) - .SetMediaDescriptionAdapter(MediaDescriptionAdapter) - .SetNotificationListener(NotificationListener) - .Build(); + //Needed for enabling the notification as a mediabrowser. NotificationListener = new NotificationListener @@ -154,6 +146,16 @@ protected virtual void PrepareNotificationManager() } }; + PlayerNotificationManager = new Com.Google.Android.Exoplayer2.UI.PlayerNotificationManager.Builder( + this, + ForegroundNotificationId, + ChannelId) + .SetChannelNameResourceId(Resource.String.XamarinMediaManagerName) + .SetChannelDescriptionResourceId(Resource.String.XamarinMediaManagerDescription) + .SetMediaDescriptionAdapter(MediaDescriptionAdapter) + .SetNotificationListener(NotificationListener) + .Build(); + //PlayerNotificationManager.SetFastForwardIncrementMs((long)MediaManager.StepSizeForward.TotalMilliseconds); //PlayerNotificationManager.SetRewindIncrementMs((long)MediaManager.StepSizeBackward.TotalMilliseconds);