2

When the page loads, the YouTube video should play the video without sound (unmuted), but I could not find a proper way to fix this.

var video = document.getElementsByClassName("embed-responsive-item");
if(video == video.mute()){
 video == video.unmute(); 
} else {
 video == video.unmute();
}
<div class="embed-responsive embed-responsive-16by9">
<iframe class="embed-responsive-item" src="https://www.youtube.com/embed/KKp9g8fTBDQ?autoplay=1"></iframe>
  </div>
Front-end Developer
  • 400
  • 1
  • 6
  • 17

0 Answers0