Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Disable swiping on viewer audio controls
Signed-off-by: John Molakvoæ <[email protected]>
Signed-off-by: nextcloud-command <[email protected]>
  • Loading branch information
skjnldsv authored and nextcloud-command committed Jan 4, 2022
commit ffb53c04369bb412bd086eaf4533ceb053995fd5
4 changes: 2 additions & 2 deletions js/viewer-main.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/viewer-main.js.map

Large diffs are not rendered by default.

11 changes: 11 additions & 0 deletions src/components/Audios.vue
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,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: {
donePlaying() {
this.$refs.audio.autoplay = false
Expand Down