Skip to main content
Known Participant
August 31, 2022
Question

HTML5 video autoplay in Dreamweaver just won't work

  • August 31, 2022
  • 2 replies
  • 648 views

Hi all,

 

I was able to get two videos, one on each page to work but the third page it won't. Not sure what the difference was. video is mp4 and I added the code manually autoplay=""

that didn't work.

selecting the box for autoplay in the properties for the video still it won't work.

what else am i missing?

thanks a bunch

    This topic has been closed for replies.

    2 replies

    Nancy OShea
    Community Expert
    Community Expert
    August 31, 2022

    I  have autoplay blockers as do most people.  Some devices block autoplay by default when video contains an audio track.

     

    Try this code: 

    <video title="Video Title" poster="path/your_poster_image.jpg" controls="controls" muted="muted" autoplay="autoplay" >
    <source src="path/your_video.mp4" type="video/mp4">
    </video>

    Replace path/your_poster_image.jpg and path/your_video.mp4 with your own paths/filenames.

     

    Hope that helps.

     

    Nancy O'Shea— Product User & Community Expert
    Nancy OShea
    Community Expert
    Community Expert
    September 3, 2022
    1. Upload the MP4 video and HTML page to your remote server to test. 
    2. Test on multple devices and browsers.
    3. You may find that what doesn't work in one browser works just fine on others.

    https://caniuse.com/?search=autoplay

     

    Failing that, contact your hosting provider to ensure the server is configured to support <video> and <audio> MIME types.

     

    If your hosting plan includes access to cPanel, you can add MIME Types yourself.

    AddType audio/mp4 .mp4 .m4a
    AddType audio/mpeg .mp1 .mp2 .mp3 .mpg .mpeg
    AddType video/mp4 .mp4 .m4v
    

     

    Nancy O'Shea— Product User & Community Expert
    Jon Fritz
    Community Expert
    Community Expert
    August 31, 2022

    Without seeing the entire code (there could be an error elsewhere causing issues like a missing doctype declaration at the top, visit http://validator.w3.org/nu to get a listing), I would try getting rid of the ="" part.

    Under the html5 doctype, simply having "autoplay" in the tag enables autoplay, as in...

    <video autoplay controls>
      <source src="MyVideo.mp4" type="video/mp4">
      Your browser does not support the video tag.
    </video>

     

    The above video will autoplay and show controls. It will also display a message for users of ancient junk browsers that don't support html5 standards.