Why is video not autoplaying? Using Dreamweaver / HTML

Viewed 24

The videos on my site are not autoplaying, and I think I have my code entered correctly. The video is inside a table. Could that be the reason it is not working? Using DreamWeaver CS6 to code. Here is one example...

 <tr>
        <td colspan="3" align="center" valign="top"><video width="640" height="360" controls="controls" autoplay="autoplay" >
          <source src="Name-Redacted.mp4" type="video/mp4" />
        </video></td>
      </tr>

I have also tried entering just 'controls autoplay' instead of 'controls="controls" autoplay="autoplay", but that didn't work either. Interesting note... I have 16 videos, each on a separate page, and 5 or 6 of them autoplay on Chrome, none of them on Firefox. Not sure what to make of that.

Can anyone help me?

1 Answers

Many browsers have added some limitations for autoplay option on videos, so the problem isn't video being inside a table.

If you don't need the sound of the video, adding muted attribute would usually fix the problem on most browsers.

Even with JavaScript you wouldn't be able to hack around the problem, since it will throw a warning in developer console.

If you don't need the sound, rewrite your code as follows:

<tr>
    <td colspan="3" align="center" valign="top"><video width="640" height="360" controls autoplay muted >
      <source src="Name-Redacted.mp4" type="video/mp4" />
    </video></td>
  </tr>
Related