MCPcopy Create free account
hub / github.com/Vishal-raj-1/Awesome-JavaScript-Projects / updateVolumeIcon

Function updateVolumeIcon

assets/js/video.js:130–145  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

128// updateVolumeIcon updates the volume icon so that it correctly reflects
129// the volume of the video
130function updateVolumeIcon() {
131 volumeIcons.forEach((icon) => {
132 icon.classList.add('hidden');
133 });
134
135 volumeButton.setAttribute('data-title', 'Mute (m)');
136
137 if (video.muted || video.volume === 0) {
138 volumeMute.classList.remove('hidden');
139 volumeButton.setAttribute('data-title', 'Unmute (m)');
140 } else if (video.volume > 0 && video.volume <= 0.5) {
141 volumeLow.classList.remove('hidden');
142 } else {
143 volumeHigh.classList.remove('hidden');
144 }
145}
146
147// toggleMute mutes or unmutes the video when executed
148// When the video is unmuted, the volume is returned to the value

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected