Hello,
Using Visual Studio 2022 C# with MonoGame.Forms 3.8.1.303
I am using the MediaPalayer to play music in a form. When the form is closed the music keeps playing until the main form is closed. Searching the Internet, I found that the function below is the way to do it.
protected override void OnExiting(object sender, EventArgs args)
{
MediaPlayer.Stop();
base.OnExiting(sender, args);
}
The problem is that OnExiting is not available in MonoGame.Forms. What is the correct way to close the media player when closing a form with MonoGame.Forms?
Thank you,