()
| 148 | // When the video is unmuted, the volume is returned to the value |
| 149 | // it was set to before the video was muted |
| 150 | function toggleMute() { |
| 151 | video.muted = !video.muted; |
| 152 | |
| 153 | if (video.muted) { |
| 154 | volume.setAttribute('data-volume', volume.value); |
| 155 | volume.value = 0; |
| 156 | } else { |
| 157 | volume.value = volume.dataset.volume; |
| 158 | } |
| 159 | } |
| 160 | |
| 161 | // animatePlayback displays an animation when |
| 162 | // the video is played or paused |