diff --git a/native/mpvVideoPlayer.js b/native/mpvVideoPlayer.js index 492aa948..e7487157 100644 --- a/native/mpvVideoPlayer.js +++ b/native/mpvVideoPlayer.js @@ -722,12 +722,15 @@ } setVolume(val, save = true) { - this._volume = val; - if (save) { - this.saveVolume((val || 100) / 100); - this.events.trigger(this, 'volumechange'); + val = Number(val); + if (!isNaN(val)) { + this._volume = val; + if (save) { + this.saveVolume(val / 100); + this.events.trigger(this, 'volumechange'); + } + window.api.player.setVolume(val); } - window.api.player.setVolume(val); } getVolume() {