mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-18 19:01:20 -08:00
add volume
This commit is contained in:
1 parent
dfd71c06b6
commit
c69c3a42ed
14 files changed
+157
-38
No files matched your search
+2
-2
@@ -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() {
|
||||
|
||||
Reference in new issue
Block a user