# Audio Player on Internet Explorer and Firefox



## Gideon (Mar 3, 2005)

Hi,

I want to display a player on my web page for audio messages but the player wont display on MS. Explorer.

Please take a look at my experimental page in Firefox and Internet Explorer. http://www.5loaves2fishes.org.nz/5L2Fexperiment.htm

Here is the relevant code:

```
<object type="audio/midi" data="Midi/Teachchildren.mid" height="44" width="230">
<param name="src" value="Midi/Teachchildren.mid" />
<param name="autostart" value="false" />
<param name="controls" value="default" />
<param name="loop" value="false" />
</object></a>
```
Can someone suggest a fix so that it works in both browsers?

Gideon


----------



## DJ-Zep (Mar 11, 2006)

```
[MEDIA=youtube]AudioStream[/MEDIA]
```
There you are sir. Any questions, just reply.


----------



## Gideon (Mar 3, 2005)

Awesome DJ! Many thanks.

Just one more question. Can most of that be put on my stylesheet and only the SRC bit placed on my page? Because, I have half a dozen pages like that and its quite a lot of code.

Thanks


----------



## DJ-Zep (Mar 11, 2006)

I'm blanking out right now as far as link statements go. You can, however, use php includes.

*Here's how:*
First, create a PHP (.php) file and put these contents in:

```
[MEDIA=youtube]AudioStream[/MEDIA]
```
Name that whatever you want (for the demo, I'll name it "music.php")

Now, go to the page you want to use the music on and rename it filenamehere.php. Don't worry, your HTML coding will still stay in tact.

Finally, add this code where you want to display the music:

```
<?php include('music.php'); ?>
```
Tell me if you have any problems or don't understand something.


----------



## Gideon (Mar 3, 2005)

Heck, Im out of my depth here. How do you write a php file and where do you upload it to relative to the file that has your audio?

Also, I might not have been clear but the Midi song is different on each page that I use the player.


----------



## Gideon (Mar 3, 2005)

*Hello again*

Hello again,

Rather than creating a php file I have pruned all the ‘params’ except ‘filename’ and ‘autostart.’ Is that permissible? It is much smaller and seems to be working in IE plus Firefox.
Here is my latest experimental page.
http://www.5loaves2fishes.org.nz/5L2Fexperiment.htm

Here is my code. Please tell me if it’s good or bad code. Also how to make FF obey the autostart-false command.)


```
[MEDIA=youtube]MediaPlayer[/MEDIA]
```


----------



## DJ-Zep (Mar 11, 2006)

This should work:

```
<object id="MediaPlayer" width="184" height="45" 
classid="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95" 
standby="Loading.. Please Wait." 
type="application/x-oleobject"> 
<param name="FileName" value="http://www.5loaves2fishes.org.nz/Midi/Icansee.mid" valuetype="ref"> 
<param name="AutoStart" value="false"> 
</object>
```
I just used PHP to help you save as much space as you could.


----------



## Gideon (Mar 3, 2005)

So close, so close but dont get sick of me yet.  

Problem with this is that the audio player shows on IE but not FF!?? Funnily enough it works on my web authoring preview. However FF refuses to work when uploaded. Heh?

Heres my latest attempt


----------



## DJ-Zep (Mar 11, 2006)

Do you have the latest version of FF? It works fine for me.


----------



## Gideon (Mar 3, 2005)

Hi DJ-Zep

All fixed now. Your help was invaluable. :3angel2:


----------



## DJ-Zep (Mar 11, 2006)

:grin: What was your problem?


----------



## Gideon (Mar 3, 2005)

Evidently FF doesn’t use ActiveX. We learn something each day. I sent the link to half a dozen people and some of them saw it and some didnt. So I posted the code you gave me on the Mozilla forum and someone suggested this tweak.


```
<object id="MediaPlayer" width="184" height="45"
classid="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95"
standby="Loading.. Please Wait."
type="application/x-oleobject">
<param name="FileName" value="http://www.5loaves2fishes.org.nz/Midi/Airbreth.mid" valuetype="ref"> <param name="AutoStart" value="false">
 
<embed src="http://www.5loaves2fishes.org.nz/Midi/Airbreth.mid" type="application/x-mplayer2"
width="184" "height="45" autostart="0">
</object>
```
And that did the trick. Here is one of my final pages:
http://www.5loaves2fishes.org.nz/Lakeside.htm

Wouldnt it be nice if Mozilla and Microsoft talked to eachother?


----------



## DJ-Zep (Mar 11, 2006)

Oh my, I just noticed I ditched the embedment. Sorry about that. Glad you found your solution, however. :grin:


----------

