Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to initially mute videos?

Tags:

video.js

I have tried:

videojs("cats").ready(function(){
myPlayer.volume(0);
});

... but it did not work. I searched here and through the documents and am not finding the answer, or using the code correctly.

like image 751
Will X Avatar asked Jul 11 '13 04:07

Will X


People also ask

How do I mute only a video on my Iphone?

Turn sound off or on for a clip: Tap the Mute button next to the volume slider. When the clip is muted, tap the Mute button again to turn sound on. When you turn off the sound for a video clip, a mute icon also appears in the upper-left corner of the clip in the timeline.

How do I mute certain videos on YouTube?

Select the video on the editing pane then click on the sound icon. You will see it crossed out which means you've successfully muted the YouTube video.


2 Answers

might be a bit late.

In your javascript, try:

myPlayer.muted(true);
like image 88
dannio Avatar answered Sep 23 '22 23:09

dannio


Okay so the answer is easy:

just add: muted to the tag, such as:

 <video id="cats" class="video-js vjs-fullscreen vjs-default-skin" muted autoplay controls loop preload="auto" width="600" height="400"
      data-setup="{}">
    <source src="x.webm" type='video/webm' /> 
  </video>
like image 44
Will X Avatar answered Sep 20 '22 23:09

Will X