Compare commits

...

2 Commits

Author SHA1 Message Date
3e68cec6ea Bumping version 2015-02-19 22:38:15 +11:00
b24d763d40 Storing volume in local storage 2015-02-19 22:37:41 +11:00
2 changed files with 25 additions and 4 deletions

View File

@ -1,6 +1,6 @@
// ==========================================================================
// Plyr
// plyr.js v1.0.6
// plyr.js v1.0.7
// https://github.com/sampotts/plyr
// ==========================================================================
// Credits: http://paypal.github.io/accessible-html5-video-player/
@ -60,6 +60,17 @@
fullscreen: {
enabled: true,
fallback: true
},
storage: {
enabled: true,
supported: function() {
try {
return "localStorage" in window && window.localStorage !== null;
}
catch(e) {
return false;
}
}
}
};
@ -782,7 +793,12 @@
function _setVolume(volume) {
// Use default if needed
if(typeof volume === "undefined") {
volume = config.volume;
if(config.storage.enabled && config.storage.supported) {
volume = window.localStorage.plyr_volume;
}
else {
volume = config.volume;
}
}
// Maximum is 10
if(volume > 10) {
@ -792,6 +808,11 @@
player.volume.value = volume;
player.media.volume = parseFloat(volume / 10);
_checkMute();
// Store the volume in storage
if(config.storage.enabled && config.storage.supported) {
window.localStorage.plyr_volume = volume;
}
}
// Mute
@ -974,7 +995,7 @@
_findElements();
// Set volume
_setVolume(config.volume);
_setVolume();
// Setup fullscreen
_setupFullscreen();

2
dist/js/plyr.js vendored

File diff suppressed because one or more lines are too long