Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

HTML5 video autoplay in Dreamweaver just won't work

Explorer ,
Aug 31, 2022 Aug 31, 2022

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

577
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 31, 2022 Aug 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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 31, 2022 Aug 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 & Moderator
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 03, 2022 Sep 03, 2022
LATEST
  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 & Moderator
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines