title: Autoplay Video with Sound
body: <p>I am a beginner in HTML and just want to write a page with a little video and a text.
  I want to autoplay the video but with sound. Since it's only possible to autoplay without sound I assume that I need javascript.</p>
  <p>This is my code so far</p>
  <p>index.html</p>
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
      &lt;head&gt;
          &lt;link rel=&quot;stylesheet&quot; href=&quot;generic.css&quot;&gt;
      &lt;/head&gt;
      &lt;body&gt;
          &lt;video autoplay=&quot;autoplay&quot; loop=&quot;&quot; class=&quot;myVideo&quot; id=&quot;myVideo&quot;&gt;
              &lt;source src=&quot;vid.mp4&quot; type=&quot;video/mp4&quot;&gt;
              Your browser does not support HTML5 video.
            &lt;/video&gt; 
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  <p>css file:</p>
  <pre><code>video {
      position: fixed;
      text-align: center;
      top: 50%;
      left: 50%;
      -webkit-transform: translate(-50%, -50%);
      transform: translate(-50%, -50%);
  }
  </code></pre>
  <p>Is it somehow possible or am I forced to use a button to autoplay?</p>