Update seeking state when paused or canceled.
// If paused, the play/pause button should read "Play"
recording.onpause = function() {
playPause.textContent = 'Play';
+ display.classList.remove('seeking');
};
// Toggle play/pause when display or button are clicked
// Cancel seek operation when cancel button is clicked
cancelSeek.onclick = function cancelSeekOperation(e) {
+ display.classList.remove('seeking');
recording.pause();
e.stopPropagation();
};
// Seek within recording if slider is moved
positionSlider.onchange = function sliderPositionChanged() {
- // Seek is in progress
- display.classList.add('seeking');
-
// Request seek
recording.seek(positionSlider.value, function seekComplete() {
display.classList.remove('seeking');
});
+
+ // Seek is in progress
+ display.classList.add('seeking');
+
};
})();
