Video mute

Developer
Size
2,131 Kb
Views
4,048

How do I make an video mute?

What is a video mute? How do you make a video mute? This script and codes were developed by [SHM] on 17 January 2023, Tuesday.

Video mute Previews

Video mute - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Video mute</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <head>
<script src="https://code.jquery.com/jquery-git2.js"></script> <meta charset="utf-8"> <title>JS Bin</title>
</head>
<body> <div id="hero">
<!-- <button class="btn unmute"></button> --> <video class="video" src="https://s3.amazonaws.com/servingsites-videos/firstbaptistchurchofnorfolk/sample-welcome-video-2.mp4" autoplay loop ></video> </div>
</body> <script src="js/index.js"></script>
</body>
</html>

Video mute - Script Codes CSS Codes

*{ padding: 0; margin: 0; box-sizing: border-box; outline: none;
}
#hero{ height: 100vh; position: relative; margin: 0 !important; top: 0; width: 100%;
}
.video{ position: relative; left: 50%; top: 50%; margin: auto; transform: translate(-50%, -50%); min-width: 100%; min-height: 100%;
}
/*///////////////////////////////////*/
.btn{ position: relative; left: 20px; bottom: 10px; height: 100px; width: 100px; background-size: cover; cursor: pointer; z-index: 1;
}
.mute { background-image: url(https://upload.wikimedia.org/wikipedia/commons/thumb/3/3f/Mute_Icon.svg/500px-Mute_Icon.svg.png);
}
.unmute{ background-image: url(http://cdn.osxdaily.com/wp-content/uploads/2010/11/sound-icon.png);
}

Video mute - Script Codes JS Codes

var $video = $('video'), $btn = $('.btn');
$btn.on('click', toggleMuteState);
$video.on('volumechange', toggleButtonClasses);
$video.prop('muted', false);
function toggleMuteState() { $video.prop('muted', !$video.prop('muted'));
}
function toggleButtonClasses() { $btn.toggleClass('mute unmute');
}
Video mute - Script Codes
Video mute - Script Codes
Home Page Home
Developer [SHM]
Username leon9208
Uploaded January 17, 2023
Rating 3
Size 2,131 Kb
Views 4,048
Do you need developer help for Video mute?

Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!

[SHM] (leon9208) Script Codes
Create amazing captions with AI!

Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!