Click to See Complete Forum and Search --> : how do people do this?
dandono
Mar 20th, 2005, 09:55 AM
hi, i have a website and i would like to create a webpage that would have a costum parameter for a control like windows media player control inside a webpage and i can change the url of it by going to a url like http://somesite/costumpage.htm?wmurl=/music.wma
and it would play music.wma without the path being coded into the page.
i seen this done on sites like launch.yahoo.com
how can i do this myself and what language is it done in.
thanks, dandono
ps. i dont have a clue about this and am asking this question to save a lot of time from making every page by making one.
mendhak
Mar 21st, 2005, 03:36 AM
Most likely, using HTML and javascript.
Embed the Windows Media Player object onto your page, and using javascript or vbscript, set the .URL property to the value specified in the querystring.
dandono
Mar 21st, 2005, 11:41 AM
yeah but how can i do that?
mendhak
Mar 23rd, 2005, 06:41 AM
http://www.dismec.unige.it/testi/fad01/wmp.html
dandono
Mar 23rd, 2005, 12:50 PM
i know how to embed controls into webpages but how can i make it change the url to what ever is after the "?wmpurl=" tag in the url?
mendhak
Mar 24th, 2005, 01:19 AM
Did you see the VBScript on that page?
dandono
Mar 24th, 2005, 04:41 AM
you can't view the source code for the launch.yahoo player
Psyrus
Mar 24th, 2005, 05:38 AM
<html>
<head>
<title>Music Player</title>
<script type = "text/javascript">
function playSong(strURL){
Player.url = strURL;
}
function stopSong(){
Player.controls.stop();
}
</script>
</head>
<body>
<object id="Player" width="0" height="0"
classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6">
</object>
<form id = "frmPlayer">
<input type = "text" id = "txtURL" />
<input type = "button" id = "cmdPlay" value = "Play" onclick = "playSong(txtURL.value);"/>
<input type = "button" id = "cmdStop" value = "Stop" onclick = "stopSong();" />
</form>
</body>
</html>
dandono
Mar 24th, 2005, 08:06 AM
i cant get your code to work.
mendhak
Mar 24th, 2005, 09:52 PM
A little elaboration on that would be helpful.
Psyrus
Mar 25th, 2005, 04:07 PM
It won't run in Firefox/Mozilla and IE with XP2 will block the Active X file.
dandono
Mar 27th, 2005, 04:57 PM
what i mean is to have a webpage that looks the same on every file and the path of it tells it what file to play. i do not want the user to be able to change the path. i am learning php so can this be done in php?
something like http://www.dws05.ath.cx/somepage.php?mpurl=/somefile.wma
ps. move this thread if you want to the php forum but i only just started to learn php.
dandono
Apr 7th, 2005, 06:48 AM
i have learnt most of php and i have made my own little script in php.
it is two files. one is a html form and the other is a dynamic php file.
this is the html file:
<html>
<head>
<title>Dan's Web Server 2005!</title>
</head>
<body>
<form action="mp.php" method="POST">
<input type="text" name="name" />
<input type="submit" />
</form>
</body>
</html>
this is the php file:
<?
$URL = $_POST["name"];
print
'<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Dans Web Server 2005!</title>
</head>
<body>
<p>
<object classid="clsid:6BF52A52-394A-11D3-B153-00C04F79FAA6" id="WindowsMediaPlayer1" width="245" height="240">
<param name="URL" value=' . $URL . '>
<param name="rate" value="1">
<param name="balance" value="0">
<param name="currentPosition" value="0">
<param name="defaultFrame" value>
<param name="playCount" value="1">
<param name="autoStart" value="-1">
<param name="currentMarker" value="0">
<param name="invokeURLs" value="-1">
<param name="baseURL" value>
<param name="volume" value="50">
<param name="mute" value="0">
<param name="uiMode" value="full">
<param name="stretchToFit" value="0">
<param name="windowlessVideo" value="0">
<param name="enabled" value="-1">
<param name="enableContextMenu" value="-1">
<param name="fullScreen" value="0">
<param name="SAMIStyle" value>
<param name="SAMILang" value>
<param name="SAMIFilename" value>
<param name="captioningID" value>
<param name="enableErrorDialogs" value="0">
<param name="_cx" value="6482">
<param name="_cy" value="6350">
</object>
</p>
<p>You are now playing ' . $URL . '.<br>You are connected to Dans Web Server 2005! on the host name <a href="http://'. $_SERVER['HTTP_HOST'] . '">' . $_SERVER['HTTP_HOST'] . '</a> ' . '</p>
</body>
</html>'
?>
the code seems to work fine on my server (http://www.dwsn.ath.cx/dev/mp.php)
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.