-
-
Notifications
You must be signed in to change notification settings - Fork 16.7k
Description
Hello,
I maintain a tool that generates video slides, and one of the export formats is RevealJS.
All slides are played as data-background-video
, see https://eertmans.be/manim-slides-starter/ for example.
I am not the first to notice that swiping on touch devices does not work on that kind of slides, see #3302 or jeertmans/manim-slides#384 (for a similar issue on my repo).
After searching a bit, it seems like the faulty lines are there:
reveal.js/js/controllers/touch.js
Lines 80 to 96 in 63e0a37
/** | |
* Checks if the target element prevents the triggering of | |
* swipe navigation. | |
*/ | |
isSwipePrevented( target ) { | |
// Prevent accidental swipes when scrubbing timelines | |
if( matches( target, 'video, audio' ) ) return true; | |
while( target && typeof target.hasAttribute === 'function' ) { | |
if( target.hasAttribute( 'data-prevent-swipe' ) ) return true; | |
target = target.parentNode; | |
} | |
return false; | |
} |
Looking at the comments, the fact that this function returns true
for data-background-*
contents seems to be an undesirable side effect, because we do not have the timeline for both the audio and the video when they are put in the background.
If that is an intended effect of the function, then it might be nice to add an optional attribute to force swipe-enabling? I.e., something that does the opposite of data-prevent-swipe
.
Thanks!