New to FP, html, etc., Need pointer

M

Mr B

I have a page that has an audio file that the visitor can play or shut off.

I also have a hyperlink that opens another page in a new window. This page
has also has an audio file, but this one starts when the page loads.

It is possible that the visitor has started the audio on the first page and
then click the link to open the second page. If this happens, both audio
files are then playing.

What I need is a solution that will immediately stop the audio from the
first page when the visitor clicks the hyperlink on the first page to open
the second page.

Any suggestions will be appreciated.

Mr B
 
T

Trevor L.

Mr B,

I would like to ask some questions and offer some ideas

How do you ask the visitor to turn music on or off?
I have this code:
<embed src="minuet.mid" width="144" height="45" autostart="true"
loop="false">
which starts automatically and plays once.

If I set autostart to false, I suppose the visitor can click on the play
button which appears (a Real Player interface comes up, at least for me) to
start it.
Do you have a custom button to start it?

How do you allow the visitor to stop the player (apart from using the stop
button in the Real Player interface)?

When your hyperlink starts the music on another page, it would seem that you
have code similar to mine, i.e autostart = "true". I have not encountered
two files playing at once , but the solution would be to ensure that the new
page is opened with target = _blank, i.e. <a href="whatever.html"
target="_blank"> This should stop the first music immediately and start the
second one
 
M

Mr B

Trevor,

I have the same code you have but I was refering to the fact the the user
has the options you mentioned. I know that I can cause a "Blank" or silent
audio file to be played with nother link.

The problem I have is that I am using the following code to open a specific
html file that is not in the current web and it has an auto start audio:
<a href="#"
onClick=javascript:window.open("/Tour/sample.html",'_blank','status=yes,top=0,left=0,width=889,height=588');>Tour Sample</a> </p>

The problem that I am trying to work through will only occur if the visitor
has clicked the link in the code above while the audio on the current page is
still playing.

I want to insure that my visitors will not have to listen to two audio files
playing at the same time.

I still have not found a work around for this.'

Any assistance that you or anyone else has would be helpful.

Mr B
 
T

Trevor L.

Hmmmm!
I'll give this a go.

One thing you could try is to pass a parameter to the called file by using
this way of specifying the file called
"/Tour/sample.html?play=no"

Then, in the called file, you retrieve the parameter 'play' and set up the
code to *not* play automatically when called by this link.

To retrieve the parameter, put this function in an externally called JS
file, or in the head section inside
<script type="text/javascript"> </script>, if you want to.

function qsobj(parm)
{
var qstring = document.location.search.substring(1)
var qpairs = qstring.split("&")
var qvbl = qpairs[parm].split("=")
return unescape(qvbl[1].replace("%20"," ").replace("+"," "))
}

To get the parameter 'play', use this in the head section
<script type="text/javascript">
var play = qsobj(0)
</script>

Then, you could code this at the point where you want the music to be

<script type="text/javascript">
if (play == 'yes')
document.write(
'<embed src="minuet.mid"
width="144" height="45" autostart="true" loop="false">')
else
document.write(
'<embed src="minuet.mid"
width="144" height="45" autostart="false" loop="false">')
</script>
(Amend to the name of your file and the width and height parameters as you
wish)

I also am a bit of a newcomer, so I am not certain that this will work, but
try it. (I could try it myself but that would duplicate the effort)

I will be interested to know if this or some variation on it works
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top