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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Audio Problem 1

Status
Not open for further replies.

Expression

Technical User
Dec 10, 2003
23
0
0
GB
I am trying to find a command to stop an audio file running when I start another on the same web site.
In what I call the menu page I have a (music)audio file running automatically which I want, which the command is “<EMBED src="church.mid" width=3 height=1 autostart="true">” which works fine. The menu stays on the left hand side of the screen no matter which other page is brought up which is what is wanted. The problem is my wife now wants to run another audio file when you open a particular page which is a voice file I have managed to get this working with the help from people on this forum, but although this new file works fine the original (music) audio file is still running which I do not want, how do I stop this file running when the voice file is running when only this page is viewed?
Can anyone help with this?
 
you could use the embeded windows media player. that way you can call

Player.controls.stop();
where "Player" is the name of the embeded media player
u might be able to do it with the regular embeded object im not sure.

Code:
<OBJECT ID="Player" width="1" height="1"  standby='Loading audio file...' CLASSID="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6">
<PARAM name="URL" value="music.mid">
<PARAM name="uiMode" value="none">
<PARAM name="AutoStart" value="True"> 
</OBJECT>

<input type="button" name="BtnPlay" value="Play" OnClick="StartMeUp()">
<input type="button" name="BtnStop" value="Stop" OnClick="ShutMeDown()">

<SCRIPT language="JavaScript">
<!--
   function StartMeUp ()
   {
       Player.controls.play();
   }

   function ShutMeDown ()
   {
       Player.controls.stop();
   }
 -->
</SCRIPT>


u can have a few copies of the object and give the object id different names Player1 Player2 etc. then just call Player1.controls.stop(), Player2.controls.play()

should work :)


I learned a bit yesterday, today i learned a lot, imagine what i'll learn tomorrow!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top