添加音量本地保存

This commit is contained in:
Harvey Zack committed 2018-10-24 17:40:01 +08:00
1 parent dcedb802ee
commit 94c47f2e52
4 files changed
+11 -7

No files matched your search

+5 -2
View File
@@ -824,6 +824,11 @@
if (percentage !== undefined) {
$video.volume = clamp(percentage, 0, 1);
notice.show("".concat(i18n.get('Volume'), ": ").concat(parseInt($video.volume * 100)));
if ($video.volume !== 0) {
setStorage('volume', $video.volume);
}
this.art.emit('volume', $video.volume);
}
@@ -1295,7 +1300,6 @@
proxy(this.$volume, 'click', function () {
_this.$volume.style.display = 'none';
_this.$volumeClose.style.display = 'block';
setStorage('volume', player.volume());
player.volume(0);
});
proxy(this.$volumeClose, 'click', function () {
@@ -1357,7 +1361,6 @@
handleWidth = _this$$volumeHandle$g.width;
var percentage = clamp(event.x - panelLeft - handleWidth / 2, 0, panelWidth - handleWidth / 2) / (panelWidth - handleWidth);
setStorage('volume', percentage);
player.volume(percentage);
}
}, {