I'm currently trying to build a website for a DJ friend of mine and I have come stuck with a couple of issues.
I've searched everywhere and put some code together but I still have problems.
I want to be able to map controls of the media player to images on the page
ie - when user clicks play image - song plays. I can currently get it working in IE but I can't get it to work in Firefox.
Problems:
1. The buttons (image buttons) will only work in IE only if
<PARAM name = "AutoStart" value="1">
if this is false then the buttons don't work.
In IE mp3 actually does not autoStart but in Firefox it does and I don't want that
Any ideas?
2 - when clicked the buttons work fine in IE
- in Firefox the buttons won't work.
Get the following error in Javascript debugger:
Player is not defined
var x = Player.playStat e;
Any ideas?
I tried document.getEle mentById but had no luck!
Javascript to play file
Expand|Select|Wrap|Line Numbers
- <SCRIPT> <!--
- function Play () {
- var x = Player.playState;
- if (x == 2) {
- Player.controls.play();
- }
- else {
- Player.URL = "tunes/Beethoven's Symphony No. 9 (Scherzo).wma";
- }
- }
- function Pause () {
- Player.controls.pause();
- }
- function VolumeUp () {
- var x = Player.settings.volume;
- Player.settings.volume = x + 10;
- }
- function VolumeDown () {
- var x = Player.settings.volume;
- Player.settings.volume = x - 10;
- }
- --> </SCRIPT>
Code for player:
Expand|Select|Wrap|Line Numbers
- <OBJECT ID="Player" width="0" height="0" CLASSID="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6">
- <PARAM name = "Volume" value="50">
- <PARAM name = "AutoStart" value="1">
- <PARAM name = "ShowDisplay" value = "false">
- <PARAM name ="ShowControls" value="false">
- <param name="DisplayMode" value="false">
- <embed type="application/x-mplayer2" pluginspage = "http://www.microsoft.com/windows/mediaplayer/"
- id ="Player" name="http://www.....com/Beethoven's Symphony No. 9 (Scherzo).wma"
- value="http://www.....com/Beethoven's Symphony No. 9 (Scherzo).wma"
- src="http://www.....com/Beethoven's Symphony No. 9 (Scherzo).wma"
- width="100"
- height="100"
- autostart ="false">
- </embed>
- </OBJECT>
- <a href= javascript:Play() title ="Play">
- <img src="play.png" border = "0" alt="Play" title ="Play"/></a>
-
- <a href= javascript:Pause() alt = "Pause"title ="Pause">
- <img src="pause.png" border = "0" alt="Pause" title ="Pause"/></a>
- <a href= javascript:VolumeDown() title ="Volume Down" alt="Volume Down" title ="Volume Down"/>-</a>
-
- <a href= javascript:VolumeUp() alt = "Volume Up"title ="Volume Up" alt="Volume Up" title ="Volume Up"/>+</a>
Any help would be great!
Cheers