Forum Moderators: coopster
I needed to dynamically create ASX files to be played with an embedded Windows Media Player.
After along search I finally found the following script:
*****AsxPlay.php**************
<?php
header("Cache-control: public");
header("Content-Disposition: filename=playlist.asx");
header("Content-Type: video/x-ms-asf;");
$channel= $_GET["channel"];
function GetStream
{
your function that will get the stream in a database or by tweaking an other page or file on the web :)
}
echo "<ASX version = \"3.0\">\n";
echo "<TITLE>". $channel . "</TITLE>";
echo "<ENTRY>\n";
echo "<REF HREF = \"". GetStream . "\" />\n";
echo "</ENTRY>\n";
echo "</ASX>\n";
?>
*****************************
the php is called by a simple link for example:
<a href="AsxPlay.php?channel=rockstation"> Rock it! </a>
Some websites periodically update their streams' names in order to get rid of leechers.
But with this PHP script you may give them a tough time to get rid of you ;-p