Jump to content

Embed Media Player Problem


deejaybet

Recommended Posts

Hey all, i need help with this code

<html><head><title>Music Player</title><script language="JavaScript">var state;//URL of song - Direct pathfunction playerinit(){ player.url="http://www.layer2hosting.com/~idesign/Philipworld/other/intro.mp3"; player.settings.autoStart = true;}//Play Functionfunction play(){ if (player.controls.isavailable('play')) {  player.controls.play();  state=setInterval("updatetime()",1000); }}//Pause Functionfunction pause(){ if (player.controls.isavailable('pause')) {  player.controls.pause();  clearInterval(state); }}//Stop Functionfunction stop(){ if (player.controls.isavailable('stop')) {  player.controls.stop();  clearInterval(state); }}//Step  Functionfunction step(){ if (player.controls.isavailable( 'step' )) player.controls.step( 1 );}//Volume down functionfunction voldown(){ if ( player.settings.volume < 5 ) {  player.settings.volume = 0; } else {  player.settings.volume -= 20; }}//Volume up functionfunction volup(){ if ( player.settings.volume > 90 ) {  player.settings.volume = 100; } else {  player.settings.volume += 20; }}//Mute Functionfunction mute(){ player.settings.mute = !player.settings.mute;}//Fast Forward function (NOT USED -  FIX)function fastforward(){ player.settings.rate = 2.0;}//Rewind function (NOT USED -  FIX)function rewind(){ player.settings.rate = -0.0;}</script></head><body onload="playerinit();"><!-- START PLAYER --><!-- Default Player Settings --><object id="player" classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" type="application/x-oleobject" width="0" height="0"><param name="autoStart" value="false"><param name="balance" value="0"><param name="currentPosition" value="0"><param name="currentMarker" value="0"><param name="enableContextMenu" value="false"><param name="enableErrorDialogs" value="false"><param name="enabled" value="true"><param name="fullScreen" value="false"><param name="invokeURLs" value="false"><param name="mute" value="true"><param name="playCount" value="1"><param name="rate" value="1"><param name="uiMode" value="none"><param name="volume" value="100"></object><!-- END Default Player Settings --><br /><!-- Player Controls  --><input TYPE="image" src="images/player/playerPlay.gif" class="but21" onmouseover=this.className="but22"; onmouseout=this.className="but21"; value="Play " name="play" onclick="play();">   <input TYPE="image" src="images/player/playerPause.gif" class="but31" onmouseover=this.className="but32"; onmouseout=this.className="but31"; value="Pause" name="pause" onclick="pause();">   <input TYPE="image" src="images/player/playerStop.gif"  class="but41" onmouseover=this.className="but42"; onmouseout=this.className="but41"; value="Stop" name="stop"  onclick="stop();">   <input TYPE="image" src="images/player/playerMinus.gif" class="but61" onmouseover=this.className="but62"; onmouseout=this.className="but61"; value="-" name="voldown"  onclick="voldown();">   <input TYPE="image" src="images/player/playerPlus.gif" class="but61" onmouseover=this.className="but62"; onmouseout=this.className="but61"; value="+" name="volup"  onclick="volup();"><!-- END Player Controls  --></body></html>

when i try that code on my browser, it works but the browser says theres an error

Line: 1Char: 1,Error: Object ExpectedCode: 0Url: http://www.layer2hosting.com/~idesign/Philipworld/tests.html
also... the code doesnt same to work for anything other than IE
Link to comment
Share on other sites

they play part and stuff works for me. But PLEASE FOR THE LOVE OF HUMANITY TAKE OFF THAT HORRIBLE MUSIC!!!

haha thats not horrible music for the peope its intended for.. its a teen website and that part is for the hardcore dance people lol...i got the player working now anyways.. just its not workin for ff.. can anyone code it for firefoxheres the new code
<html><head><title>Music Player</title><script language="JavaScript">var state;//URL of song - Direct pathfunction playerinit(){ player.url="http://www.layer2hosting.com/~idesign/Philipworld/other/intro.mp3"; player.settings.autoStart = true ;}//Play Functionfunction play(){ if (player.controls.isavailable('play')) {  player.controls.play();  state=setInterval("updatetime()",1000);  playerinfo.innerHTML = "Play"; }}//Pause Functionfunction pause(){ if (player.controls.isavailable('pause')) {  player.controls.pause();  clearInterval(state);  playerinfo.innerHTML = "Paused"; }}//Stop Functionfunction stop(){ if (player.controls.isavailable('stop')) {  player.controls.stop();  clearInterval(state);  playerinfo.innerHTML = "Stopped"; }}//Volume down functionfunction voldown(){ if ( player.settings.volume < 5 ) {  player.settings.volume = 0;  playerinfo.innerHTML = "0"; } else {  player.settings.volume -= 20;  playerinfo.innerHTML = "Volume " + player.settings.volume +"%"; }}//Volume up functionfunction volup(){ if ( player.settings.volume > 90 ) {  player.settings.volume = 100;  playerinfo.innerHTML = "Volume 100%"; } else {  player.settings.volume += 20;  playerinfo.innerHTML = "Volume " + player.settings.volume +"%"; }}//Time Functionfunction updatetime(){ playerinfo.innerHTML = player.status;}</script></head><body onload="playerinit();"><table align='center'>	<tr>		<td align="center"><!-- START PLAYER --><!-- Default Player Settings --><object id="player" classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" type="application/x-oleobject" width="0" height="0"><param name="autoStart" value="0"><param name="balance" value="0"><param name="currentPosition" value="0"><param name="currentMarker" value="0"><param name="enableContextMenu" value="0"><param name="enableErrorDialogs" value="0"><param name="enabled" value="-1"><param name="fullScreen" value="0"><param name="invokeURLs" value="0"><param name="mute" value="-1"><param name="playCount" value="1"><param name="rate" value="1"><param name="uiMode" value="none"><param name="volume" value="100"><param name="URL" value><param name="defaultFrame" value><param name="baseURL" value><param name="stretchToFit" value="0"><param name="windowlessVideo" value="0"><param name="SAMIStyle" value><param name="SAMILang" value><param name="SAMIFilename" value><param name="captioningID" value><embed id="player" type="application/x-mplayer2" src="" height="0" width="0"></object><!-- END Default Player Settings --><br /><!-- Player Controls  --><input TYPE="image" src="images/player/playerPlay.gif" alt="Play" value="Play " name="play" onclick="play();">   <input TYPE="image" src="images/player/playerPause.gif" alt="Pause" value="Pause" name="pause" onclick="pause();">   <input TYPE="image" src="images/player/playerStop.gif" alt="Stop" value="Stop" name="stop"  onclick="stop();">   <input TYPE="image" src="images/player/playerMinus.gif" alt="Volume Down" value="-" name="voldown"  onclick="voldown();">   <input TYPE="image" src="images/player/playerPlus.gif" alt="Volume Up" value="+" name="volup"  onclick="volup();"><!-- END Player Controls  -->		</td>	</tr>	<tr>		<td align="center" height="40"><font size="-1"><b><span id="playerinfo"></span></b></font></td>	</tr></table><!-- Player New State --><script language="JavaScript" for = player event = playstatechange(newstate)>switch (newstate){  case 1:   playerinfo.innerHTML = "Loading..";   break;  case 2:   playerinfo.innerHTML = "Loading...";   break;  case 3:   playerinfo.innerHTML = "Loading....";   break;  case 10:   playerinfo.innerHTML = "Press play button to load song";}</script><!-- END Player New State --></body></html>

Link to comment
Share on other sites

I would be guessing so..... and can you put those two humongous post into the ['codebox'] tag? it takes forever to scroll down because of that..

Link to comment
Share on other sites

I have heard of flash files that can do it. or html dom like this.<img id="play" onclick="document.bgsound.src=somthing" /><img id="stop" onclick="document.bgsound=nothing" />PS dont try to run that thats just a basic idea thats kinda cheesy

Link to comment
Share on other sites

ok then lol well im redesignin the buttons n stuff an whats to happen.. so now what i need top happen it:1- work in ff2- user clicks play and the button changes to pause during play (similar to windows media player 11)anyone have any ideas?EDIT: never mind bout number 2.. check www.philipworld.co.uk/tests.html for the latest update of the file

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...