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);