Java Reference
In-Depth Information
}
}
function muteClick(e) {
var target = e.target;
var video = document.getElementById("bbbVideo");
if (video.muted) {
video.muted = false;
target.innerHTML = "Mute";
} else {
video.muted = true;
target.innerHTML = "Unmute";
}
}
document.getElementById("playbackController")
.addEventListener("click", playbackClick);
document.getElementById("muteController")
.addEventListener("click", muteClick);
</script>
</body>
</html>
Save this as
ch15 _ example2.html
and open it in your browser. You should now see two buttons: Play
and Mute. Directly beneath these buttons is the video, as shown in Figure 15-5.
figure 15-5