From 6cdc0b08a3f7d05b1ade8660b397764cea497630 Mon Sep 17 00:00:00 2001 From: Moe A Date: Fri, 28 Apr 2023 21:43:24 -0700 Subject: [PATCH] and touch control for Recent Videos --- web/assets/js/bs5.videos.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/web/assets/js/bs5.videos.js b/web/assets/js/bs5.videos.js index ea3bd917..227f5f44 100644 --- a/web/assets/js/bs5.videos.js +++ b/web/assets/js/bs5.videos.js @@ -165,7 +165,7 @@ function bindFrameFindingByMouseMoveForDay(createdCardCarrier,dayKey,videos,allF function onSeek(evt, isTouch){ var offest = createdCardElement.offset() var elementWidth = createdCardElement.width() + 2 - var amountMoved = evt.pageX - offest.left + var amountMoved = (isTouch ? evt.originalEvent.touches[0] : evt).pageX - offest.left var percentMoved = amountMoved / elementWidth * 100 percentMoved = percentMoved > 100 ? 100 : percentMoved < 0 ? 0 : percentMoved var videoFound = videos[0] ? getVideoFromDay(percentMoved,reversedVideos,dayStart,dayEnd) : null @@ -196,6 +196,9 @@ function bindFrameFindingByMouseMoveForDay(createdCardCarrier,dayKey,videos,allF createdCardElement.on('mousemove',function(evt){ onSeek(evt, false) }) + createdCardElement.on('touchmove',function(evt){ + onSeek(evt, true) + }) } function getPercentOfTimePositionFromVideo(video,theEvent){ var startTime = new Date(video.time)