Jump to content

PHP loop and randomize WMP playlist


Waifthe3rd

Recommended Posts

Hi all imma noob, but here's what im stuck at. i got the WMP embedded, and have it playing a random song at the get go. but once its done it keeps looping the same song. was wonding if there was a way to add the loop funtion in my php so it plays all my songs, randomly and loops them.

 

************PHP***********

<?php

 

$url[0] = "http://www.example.com/music/example1.mp3";

$url[1] = "http://www.example.com/music/example2.mp3";

$url[2] = "http://www.example.com/music/example3.mp3";

$url[3] = "http://www.example.com/music/example4.mp3";

 

srand ((double)microtime()*1000000);

$randomnum = rand(0, count($url)-1);

header ("Location: $url[$randomnum]");

?>

 

 

**********************HTML******************

 

 

<OBJECT ID="embedded_player" height="45" width="180" classid="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95" CODEBASE="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,5,715" standby="Loading Microsoft Windows Media Player components..." type="application/x-oleobject" VIEWASTEXT>

<PARAM name="FileName" value="http://example.com/music/example.php" />

<param name="AutoStart" value="True">

<param name="ShowStatusBar" value="False">

<param name="ShowPositionControls" value="0">

<param name="Loop" value="True">

<embed name="wmplayer" TYPE="application/x-mplayer2"

pluginspace="http://www.microsoft.com/isapi/redir.dll?prd=windows&sbp=mediaplayer&ar=Media&sba=Plugin&" 

FileName="http://example.com/music/example.php"

Width="180"

Height="45"

ShowPositionControls="0"

ShowStatusBar = "False"

Loop="True"

</embed>

</OBJECT>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.