Mute Button
Easy
9
70.9% Acceptance
Your task for this lab is to create a separate Mute Button which will mute / unmute the video.
To display a video on your webpage, use the video
tag with the appropriate attributes.
<video width="320" height="240" controls> <source src="https://sample-videos.com/video123/mp4/720/big_buck_bunny_720p_1mb.mp4" type="video/mp4"> </video>
Use the source
tag inside the video
tag to provide a video source URL. The controls
attribute enables the default video player controls for the user. You can access and manipulate video properties with JavaScript. For instance, you can mute a video using the muted
property of the video
element:
const video = document.getElementById('myVideo') video.muted = true // Toggle this variable based on existing value