Merge pull request #738 from TDDR/issue-573
Added ability to change volume with scroll wheel
This commit is contained in:
commit
24adfbf89f
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue