Home > DeveloperSection > Forums > when video ends, close the active form
Jeet Verma
Jeet Verma

Total Post:110

Points:776
Posted on    December-09-2013 11:44 PM

 C# C# 
Ratings:


 1 Reply(s)
 781  View(s)
Rate this:

I'm trying to close a form in which a video is playing. I want it to close said form when the video ends.

I'm using wmp embedded into my form, with ui mode hidden.

Thanks



ezra heywood
ezra heywood

Total Post:145

Points:1019
Posted on    December-10-2013 12:00 AM

Hi Jeet,

You can subscribe to the PlayStateChange event of the player.

wmp.PlayStateChange += new AxWMPLib._WMPOCXEvents_PlayStateChangeEventHandler(wmp_PlayStateChange);

private void wmp_PlayStateChange(object sender, AxWMPLib._WMPOCXEvents_PlayStateChangeEvent e)

{

    if(e.newState == 8)

       this.Close();

}


Don't want to miss updates? Please click the below button!

Follow MindStick