Page 1 of 1

[SOLVED] - Playing Embedded Audio

Posted: Thu Mar 15, 2007 7:27 pm
by iknownothing
Hey Guys,
I have some Email Stationery (HTML) where a person recieving an email, can CHOOSE to listen to one of four audio files. So far I have them embedded and I know they work fine, however, what I want is to completely hide the Windows Media interface, and use an image to emulate clicking play (and maybe stop, but its not that important). I'd image this may require some javascript, does anyone know how this is done?

Thanks.

Posted: Thu Mar 15, 2007 7:38 pm
by nickvd
You are sending me emails that will play music?

I don't know many people would be impressed. I know lots of people who would start calling for your head though.

Posted: Thu Mar 15, 2007 7:56 pm
by iknownothing
nickvd wrote:You are sending me emails that will play music?

I don't know many people would be impressed. I know lots of people who would start calling for your head though.
Which is why Autoplay is OFF. Only when a person WANTS to listen to the audio file (which is business orientated, not music), it will be played (hopefully by a clickable image instead of the WM interface).

The file is also pulled from a website too, so the recipient doesnt have to wait 10 minutes while their email gets delivered to them (as an attachment would do).

Posted: Thu Mar 15, 2007 8:33 pm
by daedalus__
<div style="visibility: hidden">
<embed> or <object> or both
</div>


<opinion>
I really can't recommend doing this especially if the songs are going to be attachments. If I regularly got 10 megabyte e-mails from you I would probably be a little angry.
</opinion>

Posted: Thu Mar 15, 2007 8:46 pm
by iknownothing
I've figured it out using...

Code: Select all

function play(media){
document.getElementById('mediaplayer').innerHTML=
'<object classid="clsid:22d6f312-b0f6-11d0-94ab-0080c74c7e95"'
+'id="player" hidden="true" width="0" height="0">'
+'<param name="showControls" value="false">'
+'<param name="hidden" value="true">'
+'<param name="fileName" value="'+media+'">'
+'</object>'
}

Code: Select all

onclick="play('AUDIO FILE GOES HERE');"


<td id="mediaplayer"></td>
I have it set so that it will only play when someone wants it to be, and is linked to a webpage, so the files aren't an attachment. There is no reason for a recipient to get frustrated because, there is no audio until they want it.