add mute button to html5 video player

Solutions on MaxInterview for add mute button to html5 video player by the best coders in the world

showing results for - "add mute button to html5 video player"
Ivan
01 Aug 2019
1$("video").prop('muted', true);
2
3$(".mute-video").click(function () {
4    if ($("video").prop('muted')) {
5        $("video").prop('muted', false);
6        $(this).addClass('unmute-video'); // changing icon for button
7
8    } else {
9        $("video").prop('muted', true);
10        $(this).removeClass('unmute-video'); // changing icon for button
11    }
12    console.log($("video").prop('muted'))
13});