mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-23 22:01:20 -08:00
添加音量本地保存
This commit is contained in:
1 parent
dcedb802ee
commit
94c47f2e52
4 files changed
+11
-7
No files matched your search
+4
-1
@@ -1,4 +1,4 @@
|
||||
import { clamp, secondToTime } from './utils';
|
||||
import { clamp, secondToTime, setStorage } from './utils';
|
||||
import config from './config';
|
||||
|
||||
export default class Player {
|
||||
@@ -137,6 +137,9 @@ export default class Player {
|
||||
if (percentage !== undefined) {
|
||||
$video.volume = clamp(percentage, 0, 1);
|
||||
notice.show(`${i18n.get('Volume')}: ${parseInt($video.volume * 100)}`);
|
||||
if ($video.volume !== 0) {
|
||||
setStorage('volume', $video.volume);
|
||||
}
|
||||
this.art.emit('volume', $video.volume);
|
||||
}
|
||||
return $video.volume || 0;
|
||||
|
||||
Reference in new issue
Block a user