2

I added a video from my local computer in my website by using video tag, everything is working fine but video is running without sound. Sound option is greyed-out. I tried using different Video but issue still persisted.

Audio file is working totally fine. Even video I used on HTML are working in Media players also. Idk what's problem here

Here is my code snippet

    <!DOCTYPE html>
<html>

<head>
  <meta charset="UTF-8">
  <title> New Page</title>
  <style>
    video {
      width: 300px;
      height: 200px;
      border: 1px solid #666;
    }
  </style>
  <link rel="stylesheet" href="style/style.css">

</head>
<header>
  <h1>Hyperlink</h1>
</header>
<main>

  This is test!!!!!!!!
  <div id='Absoulute'>




  </div>

  <video src="video/video.mp4" controls autoplay unmuted ></video>
  <br>
  <div>

    <h2> Audio</h2>
    <audio controls>
      <source src="video/audio.mp3">
    </audio>

  </div>

</main>
    
</html>

Screenshot of Webpage. Audio option is greyed out

Stephan Bauer
  • 9,120
  • 5
  • 36
  • 58

2 Answers2

0

You cannot autoplay unmuted as it is disabled in most of browsers so use this

<video src="video/video.mp4" controls autoplay muted ></video>
  • I tried still neither video is unmuted nor its looping. Tried in many browsers –  Jul 01 '21 at 07:11
0

Remove unmuted because it is an invalid video attribute. If you want to muted the video try muted.

<video src="video/video.mp4" controls autoplay></video>

Demo codepen

Anh Nhat Tran
  • 561
  • 1
  • 6
  • 18