Skip to main content
Participant
November 7, 2017
Answered

Need help stopping Autoplay, have tried the fixes, still stumped

  • November 7, 2017
  • 4 replies
  • 3280 views

I've added an audio mp3 file to my older version of Dreamweaver MX. Works great but it autoplays everytime the page loads and I need that to stop. I've read through the forum and have tried the fix of adding a code to the parameters (autoplay="false") but it still won't stop. Here's my code:

<embed src="sermons/Adam11.5.17Sermon.mp3" width="400" height="100" align="middle" autoplay="false"></embed>

I've also tried autostart="false" and that doesn't work.

Here's the site: CUCC Sermons

Do you have any other fixes or options I could try?

Thanks, Lori

    This topic has been closed for replies.
    Correct answer Jon Fritz

    You can fight with the archaic <embed> and <object> tags and the discrepancies between browsers with autostart and autoplay, or you can move to an HTML5 doctype and simply use the <audio> tag that modern browsers treat the same.

    HTML5 <audio> doesn't auto-play by default. If you want it to autoplay, all you need to do is add the "autoplay" attribute to the <audio> tag in the same way "controls" is added below...

    <audio style="width:400px; height:100px;" controls>

          <source src="sermons/Adam11.5.17Sermon.mp3" type="audio/mp3" />

    </audio>

    You are also missing a doctype declaration on your page. Before the opening <html> tag, add in the following as the first line of your code...

    <!doctype html>

    <html>

    4 replies

    lptyAuthor
    Participant
    November 8, 2017

    Thank you Jon - that worked great! One issue though - I can't seem to move the audio player to where I want it to be on the page. I want it to be under the date November 5, 2017, but it keeps showing up way above the heading Sermons. Here is the website and code CUCC Sermons .Thanks so much!!!

                              <p align="left"><strong><font color="#000000">God Loves the Canaanites, Too</font></strong><font color="#000000"><br>

                                <font size="2">Rev. Adam Ericksen<br>

                                November 5, 2017</font></font></p>

                              <hr>

       

                              <p align="left">  <tr> <audio style="width:400px; height:100px;" controls> <source src="sermons/Adam11.5.17Sermon.mp3" type="audio/mp3" />

                          </audio>

        </p>

    B i r n o u
    Legend
    November 8, 2017

    well the snippet that you just copy paste here, doesn't correspond to the one published on line

    here are some comment on this video

    11.08.2017-09.22.37

    Jon Fritz
    Community Expert
    Jon FritzCommunity ExpertCorrect answer
    Community Expert
    November 7, 2017

    You can fight with the archaic <embed> and <object> tags and the discrepancies between browsers with autostart and autoplay, or you can move to an HTML5 doctype and simply use the <audio> tag that modern browsers treat the same.

    HTML5 <audio> doesn't auto-play by default. If you want it to autoplay, all you need to do is add the "autoplay" attribute to the <audio> tag in the same way "controls" is added below...

    <audio style="width:400px; height:100px;" controls>

          <source src="sermons/Adam11.5.17Sermon.mp3" type="audio/mp3" />

    </audio>

    You are also missing a doctype declaration on your page. Before the opening <html> tag, add in the following as the first line of your code...

    <!doctype html>

    <html>

    Community Expert
    November 7, 2017

    And then add autoplay= false and autostart = false.

    In that way also chrome could honorate the autoplay/autostart = false

    Nancy OShea
    Community Expert
    Community Expert
    November 7, 2017

    I don't recommend using audio <embed>.

    Jon's answer is the correct one.  Use the HTML5 <audio> tag. 

    Nancy O'Shea— Product User & Community Expert
    Community Expert
    November 7, 2017

    Please try to add the type properties to the embed file:

    <embed type="audio/mpeg" ...