add volume

This commit is contained in:
Harvey Zack committed 2018-10-23 13:21:39 +08:00
1 parent dfd71c06b6
commit c69c3a42ed
14 files changed
+157 -38

No files matched your search

+2 -2
View File
@@ -127,12 +127,12 @@ export default class Player {
volume(percentage) {
const { refs: { $video }, i18n, notice } = this.art;
if (percentage) {
if (percentage !== undefined) {
$video.volume = clamp(percentage, 0, 1);
notice.show(`${i18n.get('Volume')}: ${parseInt($video.volume * 100)}`);
this.art.emit('volume', $video.volume);
}
return $video.volume;
return $video.volume || 0;
}
currentTime() {