Issue
I'm playing an HLS content on CrossMediaManager. When users press back, I'm trying to dispose the player, but the player is still playing, I can see it's running on notification drawer and I can listen to video. Here is the code I've tried.
protected override void OnDisappearing()
{
base.OnDisappearing();
CrossMediaManager.Current.Dispose();
VideoPlayer.Dispose();
}
VideoPlayer is the Reference name of the VideoView.
Solution
Please put following code in your navigated page. When you back to mainpage, this plugin will be closed.
protected override void OnDisappearing()
{
base.OnDisappearing();
var player = CrossMediaManager.Current.MediaPlayer;
player.Stop();
}
}
Here is running GIF.
Answered By - Leon Lu - MSFT
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.