the windows mediaplay control
-
My applications has 2 listboxes in it, what the program does is that it will play the video from listbox1 but for each 15 seconds it will stop the video, and then play the short videos from a 2nd listbox. When the video from th e 2nd listbox finishes, it will resume playing the video from listbox1. I have a function that handles the openstatechange event and another function that handles playstatechange event. My implementation works as following: When the play button clicks, it will start playing the first item on the first listbox, the 15 seconds timer starts at the same time the video will start playing when the timer is up, the timerinterval event will fire, and in this event handler, i pause the video, store the currently playing position, and then stop the video and then use the .URL to make the wmplayer load a video from the second list. The openstate event will take care of the playing when the the openstate changes to "mediaopen" and will start playing This all works fine. Now the problems occurs when the short video finsihes playing. A playstate event handler handles the event that a media has stopped, in this case, the code loads the video from the first list to resume, and then also sets the currentplaytime. once i have set the .URL property, the playstate changes to "transitioning" and the openstate changes to "mediaopening" indefiniately. And for this reason, the .play function in my openstate event handler which only executes the .play() function when the openstate=mediaopen does not occur. am i missing something here? Maybe perhaps the video from the first list is a wmv file while video from the 2nd list is a divx avi file?
-
My applications has 2 listboxes in it, what the program does is that it will play the video from listbox1 but for each 15 seconds it will stop the video, and then play the short videos from a 2nd listbox. When the video from th e 2nd listbox finishes, it will resume playing the video from listbox1. I have a function that handles the openstatechange event and another function that handles playstatechange event. My implementation works as following: When the play button clicks, it will start playing the first item on the first listbox, the 15 seconds timer starts at the same time the video will start playing when the timer is up, the timerinterval event will fire, and in this event handler, i pause the video, store the currently playing position, and then stop the video and then use the .URL to make the wmplayer load a video from the second list. The openstate event will take care of the playing when the the openstate changes to "mediaopen" and will start playing This all works fine. Now the problems occurs when the short video finsihes playing. A playstate event handler handles the event that a media has stopped, in this case, the code loads the video from the first list to resume, and then also sets the currentplaytime. once i have set the .URL property, the playstate changes to "transitioning" and the openstate changes to "mediaopening" indefiniately. And for this reason, the .play function in my openstate event handler which only executes the .play() function when the openstate=mediaopen does not occur. am i missing something here? Maybe perhaps the video from the first list is a wmv file while video from the 2nd list is a divx avi file?
Why don't you use two mediaplayer controls (in the same place one hidden and one visible.) and get rid of all these stuff?!! Play the first video, pause it, hide its mediaplayer control, show the other control, play the short video, hide its control and so on!!!