Sound/Music Link Doesn't Work Right in Firefox & Google Chrome

I've embedded a Sound/Music link in my web page, and I've unchecked the "Autostart" box. My web page works like it's supposed to in Safari and Explorer, meaning, the audio files do not start automatically. But in Firefox and Chrome, all the audio files start playing immediately when my web site opens. Why is it doing this? I do NOT want the audio files to start automatically in ANY browser. What am I missing? Thanks!
Original Post
Sorry for not posting a link. My web site is playbookaudio.com. When you open it in Firefox or Chrome, all of the audio files start playing immediately when they shouldn't. But if you open it in Explorer or Safari, the site works like it's supposed to. Thanks!
The methods SS uses to embed audio and video on a web page are no longer valid. However, a browser will try its best to render what SS throws at it.

What you should be doing is using a code object and inserting the newer audio HTML code. For example, converting your current audio object obj273, the code would be:
 <audio controls>
  <source src="./media/The Luck Run.mp3" type="audio/mp3">
</audio>
Since you have published your page, your audio files are already in the media folder, so the code object reference should be able to find them. If you add more audio code, any additional audio files would need to be manually uploaded using an FTP client, such as Filezilla.

The reason your audio files are automatically playing is because the control word "autostart" in added by SS. The current HTML spec states that just the word "autostart" added to the code will autostart the audio, regardless if the value for this control is "true" or "false". Firefox and Chrome obey the spec while other browsers will check the value and act accordingly.
Yaaay! It worked!!! Thank you so much, larryd. Your explanation made sense, and the code you gave me was perfect. If I may, I've got two more questions.

1) I'd like the volumes to be at 50%, instead of full volume. That way the listener can raise or lower it to their like. What code do I use, and where does it go?

2) obj165: It's located between the pictures of the women's ensemble. Is there a way to scale the control so that it's the same width as the pictures?

Thank you so very much for your help!

EB
1. Volume control: Add a new code object to your page, set the code placement to "Above End Body Tag", and enter:
<script>
  var allAudio = document.getElementsByTagName('audio');
  for (i=0; i<allAudio.length; i++) {
   allAudio[i].volume="0.5";
  };
</script>
The placement for this code is important as all the HTML code must be loaded in the browser first. The volume value can range from "0.0" (mute) to "1.0" (full volume).

2. Player size: Add a new code object, set the code placement to "in CSS", and enter:
#Oobj165 audio { width: 225px; }
Adjust the pixel value as needed.
First of all, I can't thank you enough for your help. It really means a lot to me.

Next, the player size worked perfect!

Lastly, the only choices offered for code placement in this version of SS (2.91 i) are: In Body, Header, in CSS, Above All, Below All, Above Body, and Below Body. I tried the most obvious choices -- Header, Above All, and Above Body -- but none of them made a difference. And, just for grins, I tried the other choices, too, but no difference either. What do you recommend I try next?

Again, thank you so much for your help. Once this is fixed, I promise to not bother you again. Smile

EB
If you have your SS program registration info, download and install the latest version. However, the last time I looked the standard version of SS is now free.

If you cannot upgrade, do the following:

Change the script to:
<script>
function setVolumes() {
  var allAudio = document.getElementsByTagName('audio');
  for (i=0; i<allAudio.length; i++) {
   allAudio[i].volume="0.5";
  };
}
</script>
<body onload='setVolumes()'>
Set the code placement to "Header".

BTW, it's no bother. We're here to help.
Yaaay! It worked! Thank you so much for your time. I couldn't be happier!

I did download the latest Pro version but for some reason there's a problem getting it registered, so I just choose "Remind Me Later". All in all, it does what I need it to do, and it's all good.

Well, larryd, I do appreciate your help. It's been terrific. Stay well.

Add Reply

Likes (0)
×
×
×
×