Geekpedia Forums Logo

Scripting WMP Playlist creation

by virgie woodward on Thursday, June 22nd - 5:02 PM



I am a web designer freelance and a rookie tech A+ who is seeking a solution to imbed WMP into the web site, which I have done successfully; however, I want to play one movie right behind the other in the same player.  Isn't there a way to create a playlist using WMP.  ** I have embedded the player a milion times, but would like several movies to play back to back on same player.

Or an alternative, know light Flash, and Photoshop.  Any suggestions.   Thanks in advance.  I have searched high and low for this.  I have read about  "playlist. mU3, my formats are converted to the smaller ".wmv" type. 

You need to use an M3U Playlist. Here's how it works: you upload the WMV files you want to put in the playlist into a folder via FTP or whatever you're using. Then you create an M3U playlist; an M3U playlist is simply a small file containing paths to the files that you wish to play, in the order in which you want them played. Then in the code for the embedded WMP instead of linking to an WMV file like you would do to play a single video, you now link to the M3U playlist.

So you were a little confused about this judging from your statement:

I have read about  "playlist. mU3, my formats are converted to the smaller ".wmv" type.

You basically still use WMV; M3U is just a file that forms the playlist by containing the paths to the WMV files.

Thanks so much, it worked like a charm.  Only took me a week of research to find out, but it was well worth it. 

Thanks.!!!!

If you just had a directory of MP3's or WMA's you can easily create a program to look inside the directory and create a playlist on the fly. That way if you ever want too allow more mp3's being played or you do is upload them!

Hello,
I need to do the videos run in IE created buttons, but I can not push forward and backward In IE.  And i can not also do run on Firefox and Safari with Mac OS 11.
Do you help me?

My code is:

<script>

  if (-1 != navigator.userAgent.indexOf("Safari"))

      {
      document.write ('<BR>');
      document.write ('<table width="0" border="0" align="left" cellpadding="0" cellspacing="0">');
      document.write ('<tr>');
      document.write ('<td>');
       document.write ('<object id="WMP" classid="clsid:6BF52A52-394A-11d3-B153-00C04F79FAA6" standby="Carregando..." type="application/x-mplayer2" width="360" height="250">');
      document.write ('<param name="url" value="hhttp://midia.com.xxx-rio.br/tvcultura/20080609_socine4.wmv">');
      document.write ('<param name="stretchToFit" value="true">');
      document.write ('<param name="uiMode" value="mini">');
      document.write ('<param name="AutoStart" value="true">');
      document.write ('<param name="ShowControls" value="true">');
      document.write ('<param name="Volume" value="70">');
      document.write ('</object>');
      document.write ('</td>');
      document.write ('</tr>');
      document.write ('</table>');

    }                  

</script>            

<script>

if(-1 != navigator.userAgent.indexOf("MSIE"))
      {

      document.write ('<table width="0" border="0" align="left" cellpadding="0" cellspacing="0">');
      document.write ('<tr>');
      document.write ('<object id="WMP" classid="clsid:6BF52A52-394A-11d3-B153-00C04F79FAA6" type="application/x-oleobject" standby="Carregando..." width="360" height="250">');
      document.write ('<param name="Name" value="WMP1">');
      document.write ('<param name="url" value="http://midia.com.xxx-rio.br/tvcultura/20080609_socine4.wmv">');
      document.write ('<param name="UiMode" value="none">');
      document.write ('<param name="StretchToFit" value="true">');
      document.write ('<param name="AutoStart" value="true">');
      document.write ('<param name="CurrentPosition" value="true">');
      document.write ('<param name="ShowControls" value="true">');
      document.write ('<param name="Volume" value="70">');
      document.write ('</object>');
      document.write ('</tr>');

      document.write ('<tr>');
      document.write ('<td><input type=\"image\" src=\"/templates/htm/xxxdigital/img/bt_play_tv.jpg\" width=\"30\" height=\"32\" border=\"0\" alt=\"Iniciar\" VALUE=\"Play\" ONCLICK=\"StartMeUp()\"></td>');
      document.write ('<td><input type=\"image\" src=\"/templates/htm/xxxdigital/img/bt_stop_tv.jpg\" width=\"30\" height=\"32\" border=\"0\" alt=\"Parar\" VALUE=\"Stop\" ONCLICK=\"ShutMeDown()\"></td>');
      document.write ('<td><input type=\"image\" id=\"cmdStandAlone\" src=\"/templates/htm/xxxdigital/img/bt_aumentar_tv.jpg\" width=\"30\" height=\"32\" border=\"0\" alt=\"Desplugar\" VALUE=\"Play\" ONCLICK=\"StartMeUp()\"></td>');
      document.write ('<td><img src=\"/templates/htm/xxxdigital/img/bt_fundo_tv.jpg\" width=\"150\" height=\"32\" border=\"0\"></td>');
      document.write ('<td><input type=\"image\" src=\"/templates/htm/xxxdigital/img/bt_retroceder_tv.jpg\" width=\"30\" height=\"32\" border=\"0\" alt=\"Retroceder\" VALUE=\"Rew\" ONCLICK=\"ReverseIt()\"></td>');
      document.write ('<td><input type=\"image\" src=\"/templates/htm/xxxdigital/img/bt_avancar_tv.jpg\" width=\"30\" height=\"32\" border=\"0\" alt=\"Avançar\"  VALUE=\"Ffwd\" ONCLICK=\"ForwardIt()\"></td>');
      document.write ('<td><input type=\"image\" src=\"/templates/htm/xxxdigital/img/bt_volume_menos_tv.jpg\" width=\"30\" height=\"32\" border=\"0\" alt=\"-\" VALUE=\"Stop\" ONCLICK=\"VolumeDown()\"></td>');
      document.write ('<td><input type=\"image\" src=\"/templates/htm/xxxdigital/img/bt_volume_mais_tv.jpg\" width=\"30\" height=\"32\" border=\"0\" alt=\"+\" VALUE=\"Stop\" ONCLICK=\"VolumeUp()\"></td>');      
      document.write ('</tr>');
      document.write ('</table>');

      }              

else if(-1 != navigator.userAgent.indexOf("Firefox"))

      {

      document.write ('<BR>');
      document.write ('<table width="0" border="0" align="left" cellpadding="0" cellspacing="0">');
      document.write ('<tr>');
         document.write ('<td>');
       document.write ('<object id="WMP" classid="clsid:6BF52A52-394A-11d3-B153-00C04F79FAA6" standby="Carregando..." type="application/x-ms-wmp" width="360" height="250">');
      document.write ('<param name="url" value="http://midia.com.xxx-rio.br/tvcultura/20080609_socine4.wmv">');
      document.write ('<param name="stretchToFit" value="true">');
      document.write ('<param name="uiMode" value="mini">');
      document.write ('<param name="AutoStart" value="true">');
      document.write ('<param name="ShowControls" value="true">');
      document.write ('<param name="Volume" value="70">');
      document.write ('</object>');
      document.writeln('</td>');
      document.writeln('</tr>');
      document.writeln('</table>');

      }
</script>            

</center>
</div>
</body>

</DIV>

<script language="JavaScript">
<!--

var Player =  document.getElementById('WMP');
             
        var WMState = new Array();        
         WMState[0]  = "Undefined";
         WMState[1]  = "Stopped";
         WMState[2]  = "Paused";
         WMState[3]  = "Playing";
         WMState[4]  = "Scan Forward";
         WMState[5]  = "Scan Reverse";
         WMState[6]   = "Buffering...";
         WMState[7]  = "Waiting";
         WMState[8]  = "Media Ended";
         WMState[9]  = "Transitioning";
         WMState[10] = "Ready";
         WMState[11] = "Reconnecting";        
         
         function Status ()
         {
            x = Player.playState;
            alert("Windows Media  Player is " + WMState[x] + "\r\r" + "Player Version:"  + Player.versionInfo);
         }
         
         function Play ()
         {

            x = Player.playState;
            if (x == 2)
            {
                Player.controls.play();
            }
            else
            if (x == 3)
            {
                Player.controls.pause();
            }
            else
            {
                       
                Player.URL = "http://midia.com.xxx-rio.br/tvcultura/20080609_socine4.wmv";
                Player.AutoStart = true;
            }          
          }      
         
         function Stop ()
         {
            Player.controls.stop();
         }
       
         function Rew()
         {
            y = Player.controls.currentPosition;
            Player.controls.currentPosition = y - 10;        
         }
       
         function Ffwd()
         {
            y = Player.controls.currentPosition;
            Player.controls.currentPosition = y + 10;
         }
       
          function VolumeUp ()
         {              
            X = Player.settings.volume;
            Player.settings.volume = X +  10;      
         }
         
         function VolumeDown ()
         {
            X = Player.settings.volume;                  
            Player.settings.volume = X - 10;
         }

</script>


Thanks,
lffaro.