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.
[SOLVED] - Playing Embedded Audio
Moderator: General Moderators
- iknownothing
- Forum Contributor
- Posts: 337
- Joined: Sun Dec 17, 2006 11:53 pm
- Location: Sunshine Coast, Australia
[SOLVED] - Playing Embedded Audio
Last edited by iknownothing on Thu Mar 15, 2007 8:48 pm, edited 2 times in total.
- iknownothing
- Forum Contributor
- Posts: 337
- Joined: Sun Dec 17, 2006 11:53 pm
- Location: Sunshine Coast, Australia
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).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.
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).
- daedalus__
- DevNet Resident
- Posts: 1925
- Joined: Thu Feb 09, 2006 4:52 pm
- iknownothing
- Forum Contributor
- Posts: 337
- Joined: Sun Dec 17, 2006 11:53 pm
- Location: Sunshine Coast, Australia
I've figured it out using...
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.
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>