Created
August 19, 2014 05:45
-
-
Save norio-nomura/efb2dbf219f69cf9cacb to your computer and use it in GitHub Desktop.
Restore/Save Audio Volume
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript:$.getScript('//cdnjs.cloudflare.com/ajax/libs/jquery-cookie/1.4.1/jquery.cookie.min.js', function(){ | |
audioVolume = $.cookie('audioVolume'); | |
$('audio').each(function(){ | |
if (audioVolume) { | |
this.player.setVolume(audioVolume); | |
} | |
$(this).on('volumechange', function(){ | |
$.cookie('audioVolume', this.player.getVolume(), {expires: 100, path: '/'}); | |
}); | |
}); | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment