Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. the windows mediaplay control

the windows mediaplay control

Scheduled Pinned Locked Moved Visual Basic
questioncareer
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • 2 Offline
    2 Offline
    2hdass
    wrote on last edited by
    #1

    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?

    M 1 Reply Last reply
    0
    • 2 2hdass

      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?

      M Offline
      M Offline
      MohammadAmiry
      wrote on last edited by
      #2

      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!!!

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups