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(); } }
this wont work.
ReplyDeletetry this:
private void timer1_Tick(object sender, EventArgs e)
{
// Subtract the current position from the duration of the current media to get
// the time remaining. Use the Math.floor method to round the result down to the
// nearest whole number.
double t = Math.Floor(player.currentMedia.duration - player.Ctlcontrols.currentPosition);
lenght = player.currentMedia.duration.ToString();
label2.Text = lenght;
// Display the time remaining in the current media.
label1.Text = ("Seconds remaining: " + t.ToString());
if (player.playState == WMPLib.WMPPlayState.wmppsStopped)
{
player.Ctlcontrols.play();
}
and write this into playbutton.click:
timer1.Interval = 1000;
timer1.Start();
I wil check it definitely.
Delete