Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Playing Audio in browser window in an odd way?

Status
Not open for further replies.

mechro99

Programmer
Nov 27, 2001
54
US
Okay, I know the subject wasn't very descriptive. I don't know if this is possible, but you brilliant types have helped me with so much, I thought I'd give it a try.

I'm doing a site for a talent agency. They want to have a section that has a vintage radio-type interface that plays different music when tuned to different "stations" by pushing buttons. Main point stumping me: Playing the audio without showing the media player device. The only way I can think to do this for sure is in a flash movie that contains all the music, which seems to be simple, but maybe too long to load.

Does anyone have ideas? Hope I explained the problem well enough.
 
You could put the Media Player ActiveX control in another frame and hide it inside a <div> tag like so:
Code:
<div id=&quot;Cloak&quot; style=&quot;visibility:hidden&quot;>
<object classid=&quot;CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95&quot; id=&quot;mySound&quot;>
<param name=&quot;Filename&quot; value=&quot;mySound.wav&quot;>
<param name=&quot;AutoStart&quot; value=&quot;False&quot;>
<param name=&quot;ShowControls&quot; value=&quot;True&quot;>
<param name=&quot;ShowStatusBar&quot; value=&quot;False&quot;>
<param name=&quot;ShowDisplay&quot; value=&quot;False&quot;>
<param name=&quot;AutoRewind&quot; value=&quot;True&quot;>
<embed type=&quot;application/x-mplayer2&quot; pluginspage=&quot;[URL unfurl="true"]http://www.microsoft.com/Windows/Downloads/Contents/MediaPlayer/&quot;[/URL] filename=&quot;mySound.wav&quot; autostart=&quot;False&quot; showcontrols=&quot;True&quot; showstatusbar=&quot;False&quot; showdisplay=&quot;False&quot; autorewind=&quot;True&quot; id=&quot;mySound&quot;>
</embed> 
</object>
</div>
And play the sound / music by using:
Code:
<script>
<!--
mySound.play();
//-->
</script>
 
Could I do the same using real audio instead of mp3 or wav documents?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top