Watch: set volume's session value to 0 when the player is muted (#1352)

This commit is contained in:
PikachuEXE 2021-06-15 01:15:46 +08:00 committed by GitHub
parent f6c2e0937b
commit 588b488856
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 2 deletions

View File

@ -447,8 +447,10 @@ export default Vue.extend({
}
},
updateVolume: function (event) {
const volume = this.player.volume()
updateVolume: function (_event) {
// 0 means muted
// https://docs.videojs.com/html5#volume
const volume = this.player.muted() ? 0 : this.player.volume()
sessionStorage.setItem('volume', volume)
},