Skip to content

Commit 3b12e91

Browse files
authored
Merge pull request #1121 from nextcloud/fix/disable-swiping-controls-audio
2 parents 743d487 + ffb53c0 commit 3b12e91

File tree

3 files changed

+14
-3
lines changed

3 files changed

+14
-3
lines changed

js/viewer-main.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/viewer-main.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/components/Audios.vue

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,17 @@ export default {
8383
},
8484
},
8585
86+
mounted() {
87+
// Prevent swiping to the next/previous item when scrubbing the timeline or changing volume
88+
[...this.$el.querySelectorAll('.plyr__controls__item')].forEach(control => {
89+
if (!control?.addEventListener) {
90+
return
91+
}
92+
control.addEventListener('mouseenter', this.disableSwipe)
93+
control.addEventListener('mouseleave', this.enableSwipe)
94+
})
95+
},
96+
8697
methods: {
8798
donePlaying() {
8899
this.$refs.audio.autoplay = false

0 commit comments

Comments
 (0)