Persist video volume in a cookie so that subsequent events remember the volume level.

This commit is contained in:
Isaac Connor 2020-08-26 15:15:10 -04:00
parent b5ef7b08b9
commit 74d2ba56db
1 changed files with 6 additions and 0 deletions

View File

@ -1077,6 +1077,12 @@ function initPage() {
vid.on('click', function(event) {
handleClick(event);
});
vid.on('volumechange', function() {
Cookie.write('volume', vid.volume(), {duration: 10*365});
});
if ( Cookie.read('volume') != null ) {
vid.volume(Cookie.read('volume'));
}
vid.on('timeupdate', function() {
$j('#progressValue').html(secsToTime(Math.floor(vid.currentTime())));
});