Friday, July 27, 2018
How to play a media file in a loop in Windows media player in net C
How to play a media file in a loop in Windows media player in net C
We can achieve this through: // Set the PlayCount property to a big number and normally before the countdown finishes user // will interact with system definitly axWindowsMediaPlayer1.settings.playCount = 200000000; // Set the Mode Loop to true axWindowsMediaPlayer1.settings.setMode("Loop", true); // in PlayStateChange event, when it is observed that media player state is stopped then play // is again axWindowsMediaPlayer1.PlayStateChange += new AxWMPLib._WMPOCXEvents_PlayStateChangeEventHandler(axWindowsMediaPlayer1_PlayStateChange);
void axWindowsMediaPlayer1_PlayStateChange(object sender, AxWMPLib._WMPOCXEvents_PlayStateChangeEvent e)
{
if (axWindowsMediaPlayer1.playState == WMPLib.WMPPlayState.wmppsStopped)
{
axWindowsMediaPlayer1.Ctlcontrols.play();
}
}
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment