From df828e7d4ac82c0081c62301b14ef70780c8612f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Molakvo=C3=A6?= Date: Wed, 29 Dec 2021 08:17:02 +0100 Subject: [PATCH] Disable swiping on viewer video controls MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: John Molakvoæ --- src/components/Videos.vue | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/components/Videos.vue b/src/components/Videos.vue index 8fd734e2e..3d16d8e00 100644 --- a/src/components/Videos.vue +++ b/src/components/Videos.vue @@ -104,6 +104,17 @@ export default { }, }, + mounted() { + // Prevent swiping to the next/previous item when scrubbing the timeline or changing volume + [...this.$el.querySelectorAll('.plyr__controls__item')].forEach(control => { + if (!control?.addEventListener) { + return + } + control.addEventListener('mouseenter', this.disableSwipe) + control.addEventListener('mouseleave', this.enableSwipe) + }) + }, + methods: { // Updates the dimensions of the modal updateVideoSize() {