Skip to content

Commit a283000

Browse files
skjnldsvnextcloud-command
authored andcommitted
Disable swiping on viewer video controls
Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com> Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
1 parent 6a57fce commit a283000

3 files changed

Lines changed: 14 additions & 3 deletions

File tree

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/Videos.vue

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,17 @@ export default {
104104
},
105105
},
106106
107+
mounted() {
108+
// Prevent swiping to the next/previous item when scrubbing the timeline or changing volume
109+
[...this.$el.querySelectorAll('.plyr__controls__item')].forEach(control => {
110+
if (!control?.addEventListener) {
111+
return
112+
}
113+
control.addEventListener('mouseenter', this.disableSwipe)
114+
control.addEventListener('mouseleave', this.enableSwipe)
115+
})
116+
},
117+
107118
methods: {
108119
// Updates the dimensions of the modal
109120
updateVideoSize() {

0 commit comments

Comments
 (0)