Windows Media Player help

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • 1stOnRamp
    Forum Member
    • Feb 2004
    • 27

    Windows Media Player help

    I've made a player that receives a shoutcast stream and plays if fine on the computer.

    What i want to do now is if the stream should stop and then restart, i would like the player to restart playing.

    so what i need is some kind of timer that will check the status of the player like every 10 seconds and if it has stopped or paused, i would like it the try to start playing again.
  • Corey
    Indigo Rose Staff Alumni
    • Aug 2002
    • 9745

    #2
    Hi. Well the page timer is probably the ticket, but I'm unclear exactly what we're checking. Is it a check to see, "If an instance of the Media Player plug-in object is currently playing" ?

    Comment

    • 1stOnRamp
      Forum Member
      • Feb 2004
      • 27

      #3
      in Page Properties:On Show i have the following code and it starts the stream playing fine.
      Code:
      Page.StartTimer(10000);
      MediaPlayer.Load("plgMSMediaPlayer","http://216.69.164.190:7000");
      MediaPlayer.Play("plgMSMediaPlayer");
      in Page Properties:On Timer i have the following code and this is where it is not working. If the stream should stop, i want the player to retry the connection every 10 seconds until it reconnects. But it doesnt.
      Code:
      if ((MediaPlayer.GetState("plgMSMediaPlayer") == VIDEO_PLAYING)) then
      else
          MediaPlayer.Load("plgMSMediaPlayer","http://216.69.164.190:7000");
          MediaPlayer.Play("plgMSMediaPlayer");
      end

      Comment

      • Corey
        Indigo Rose Staff Alumni
        • Aug 2002
        • 9745

        #4
        Try this in your timer:

        Code:
        if MediaPlayer.GetState("plgMSMediaPlayer")~=VIDEO_PLAYING then
            MediaPlayer.Load("plgMSMediaPlayer","http://216.69.164.190:7000");
            MediaPlayer.Play("plgMSMediaPlayer");
        end

        Comment

        • 1stOnRamp
          Forum Member
          • Feb 2004
          • 27

          #5
          Didnt work.

          Comment

          • Corey
            Indigo Rose Staff Alumni
            • Aug 2002
            • 9745

            #6
            Hi. It works OK over here, here's a working example attached which restarts if it's been stopped for more than one second. Hope that helps.
            Attached Files

            Comment

            Working...
            X