Skip to content

Commit

Permalink
MAUI Android audio stops after running in the background for about 15…
Browse files Browse the repository at this point in the history
… minutes Baseflow#900
  • Loading branch information
Abdul Hamidy authored and Abdul Hamidy committed Jul 23, 2024
1 parent e81cd27 commit 4cc3a96
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions MediaManager/Platforms/Android/MediaSession/MediaBrowserService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -115,16 +115,6 @@ 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
{
Expand Down Expand Up @@ -154,6 +144,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);

Expand Down

0 comments on commit 4cc3a96

Please sign in to comment.