! Fix possible to do both actions in video player by scrolling (#2989)

"Scroll playback rate over video player" and "Skip by Scrolling Over Video Player"
This commit is contained in:
PikachuEXE 2022-12-25 20:06:18 +08:00 committed by GitHub
parent 90ac5e6bce
commit 1a0786f39b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 0 deletions

View File

@ -729,6 +729,11 @@ export default Vue.extend({
},
mouseScrollSkip: function (event) {
// Avoid doing both
if ((event.ctrlKey || event.metaKey) && this.videoPlaybackRateMouseScroll) {
return
}
// ensure that the mouse is over the player
if (event.target && (event.target.matches('.vjs-tech') || event.target.matches('.ftVideoPlayer'))) {
event.preventDefault()