mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-23 13:51:20 -08:00
update gestureInit.js
This commit is contained in:
1 parent
ae3ffc8105
commit
92cd112aa2
3 files changed
+8
-8
No files matched your search
@@ -22,7 +22,7 @@ export default function gestureInit(art, events) {
|
||||
if (event.touches.length === 1 && isDroging) {
|
||||
const widthDiff = event.touches[0].clientX - startX;
|
||||
const proportion = clamp(widthDiff / $video.clientWidth, -1, 1);
|
||||
currentTime = clamp(art.currentTime + 60 * proportion, 0, art.duration);
|
||||
currentTime = clamp(art.currentTime + art.duration * proportion, 0, art.duration);
|
||||
notice.show = `${secondToTime(currentTime)} / ${secondToTime(art.duration)}`;
|
||||
}
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user