diff --git a/src/renderer/components/ft-video-player/ft-video-player.js b/src/renderer/components/ft-video-player/ft-video-player.js index 452564ad..c1caf303 100644 --- a/src/renderer/components/ft-video-player/ft-video-player.js +++ b/src/renderer/components/ft-video-player/ft-video-player.js @@ -193,7 +193,9 @@ export default Vue.extend({ this.player.on('mousemove', this.hideMouseTimeout) this.player.on('mouseleave', this.removeMouseTimeout) + this.player.on('volumechange', this.updateVolume) + this.player.controlBar.getChild('volumePanel').on('mousewheel', this.mouseScrollVolume) const v = this @@ -216,6 +218,25 @@ export default Vue.extend({ sessionStorage.setItem('volume', volume) }, + mouseScrollVolume: function (event) { + if (event.target) { + event.preventDefault() + + if (this.player.muted() && event.wheelDelta > 0) { + this.player.muted(false) + this.player.volume(0) + } + + if (!this.player.muted()) { + if (event.wheelDelta > 0) { + this.changeVolume(0.05) + } else if (event.wheelDelta < 0) { + this.changeVolume(-0.05) + } + } + } + }, + determineFormatType: function () { if (this.format === 'dash') { this.enableDashFormat()