Mobile Video Seek Gesture

모바일 브라우저에서 좌우 스와이프 제스처로 동영상 탐색 및 길게 눌러 2배속 재생 (Shadow DOM 포함)

Forfatter
FlyingGorae
Daglige installasjoner
0
Totale installasjoner
6
Vurderinger
1 0 0
Versjon
4.0
Lagd
23.01.2025
Oppdatert
09.03.2025
Size
7,4 kB
Lisens
MIT
Gjelder
Alle sider

Video Assistant by Gesture


You can navigate videos on your mobile browser using left and right swipe gestures (like the Video Assistant on Samsung Internet Browser).


Code made by ChatGPT




#Update

v4.0
Added the function of long-pressing to accelerate the video.






You can adjust the sensitivity by changing the value after 'deltaX'.

timeChange = deltaX * 0.05; // 민감도 값 조정



You can adjust the accelerated speed when you long press by adjusting the numbers shown below.
You can also change the message displayed when the video is accelerated by modifying the '2x Speed' part.

video.playbackRate = 2.0; // 2배속
video.overlay.innerHTML = `2x Speed`;






There may be some videos where the gesture doesn't work.
This seems to be rarely on iOS and a little bit on Android.



Depending on the video playback environment, the long press acceleration function may not work properly. The code would be too messy to consider all cases, so it is made to be applied in general situations. If there is a bug, it is recommended to use the previous version (v3.7).