aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSam Potts <me@sampotts.me>2016-02-25 19:35:03 +1100
committerSam Potts <me@sampotts.me>2016-02-25 19:35:03 +1100
commit1ecbec40444e1d36f1cf70a97805fd54021cb577 (patch)
treef6ea44f8f69db80fea7f9c76727a6538f280be52 /src
parentab329b99df6516b12fd40201dc74fd4432e35605 (diff)
downloadplyr-1ecbec40444e1d36f1cf70a97805fd54021cb577.tar.lz
plyr-1ecbec40444e1d36f1cf70a97805fd54021cb577.tar.xz
plyr-1ecbec40444e1d36f1cf70a97805fd54021cb577.zip
Volume storage fix (Fixes #171)
Diffstat (limited to 'src')
-rw-r--r--src/js/plyr.js8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/js/plyr.js b/src/js/plyr.js
index 637a267c..6066fcff 100644
--- a/src/js/plyr.js
+++ b/src/js/plyr.js
@@ -107,7 +107,7 @@
},
storage: {
enabled: true,
- key: 'plyr_volume'
+ key: 'plyr'
},
controls: ['restart', 'rewind', 'play', 'fast-forward', 'current-time', 'duration', 'mute', 'volume', 'captions', 'fullscreen'],
i18n: {
@@ -1869,11 +1869,15 @@
if (config.storage.enabled && _storage().supported) {
volume = window.localStorage.getItem(config.storage.key);
+
+ // Clean up old volume
+ // https://github.com/Selz/plyr/issues/171
+ window.localStorage.removeItem('plyr-volume');
}
}
// Use config if all else fails
- if(isNaN(volume)) {
+ if(volume === null || isNaN(volume)) {
volume = config.volume;
}