private void screenbutton_Click(object sender, EventArgs e)
{
this.Visible = false;
if(onscreen)
{
onscreen = false;
screenbutton.StopInfoFlash();
General.Display.ShowNothing();
onscreeninfo.Visible = false;
if(isplaying)
{
// Continue playing media here
PlayFile(playingfile, currentmediapos);
}
}
else
{
onscreen = true;
screenbutton.StartInfoFlash();
updatetimer.Stop();
if(isplaying)
{
// Stop playing media here
stopintended = true;
muxplayer.Ctlcontrols.stop();
muxplayer.close();
player.Ctlcontrols.stop();
player.close();
ispaused = false;
muxingfileplaying = "";
pausebutton.StopInfoFlash();
pausebutton.Text = "Pause";
onscreeninfo.Visible = true;
// Show media player and continue media
General.Display.ShowMediaPlayer(playingfile, currentmediapos, muxingfile);
}
else
{
// Show media player without content
General.Display.ShowMediaPlayer(null, 0, null);
}
}
this.Visible = true;
}