Skip to content

Commit 6524f72

Browse files
committed
Disable swiping on viewer audio controls
Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
1 parent da237d1 commit 6524f72

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

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)