修改包管理

This commit is contained in:
Harvey Zack committed 2018-11-07 17:12:42 +08:00
1 parent c5c673ae79
commit 0aa018db6d
99 files changed
+70 -70

No files matched your search

@@ -0,0 +1,19 @@
import { clamp, setStorage } from '../utils';
export default function volumeMix(art, player) {
const { refs: { $video }, i18n, notice } = art;
Object.defineProperty(player, 'volume', {
value: percentage => {
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);
}
art.emit('volume', $video.volume);
}
return $video.volume || 0;
}
});
}