Video startar with autoplay, but with volume at 50% or mute!

1

My video tag shows my video / audio controls perfectly. Everything working. But I need to set the audio between 30% and 50% or even mute. Is it possible to do this with CSS and / or JS?

<video width="960" height="550" controls autoplay loop>
    <source src="video.mp4" type="video/mp4">
    <source src="movie.ogg" type="video/ogg">
    Seu navegador não suporta o aquivo de vídeo.
</video>
    
asked by anonymous 10.12.2014 / 18:36

1 answer

3

To put video or mute audio:

<video muted id="myVideo">
....
</video>

To control volume use javascript:

var vid = document.getElementById("myVideo");
vid.volume = 0.2;

Using jQuery:

$("myVideo").prop("volume", 0.5);

Sources: W3schools , W3Schools

    
10.12.2014 / 18:45