Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
3e68cec6ea | |||
b24d763d40 |
@ -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
2
dist/js/plyr.js
vendored
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user