mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-26 08:51:20 -08:00
add Artplayer.TOUCH_MOVE_RATIO
This commit is contained in:
1 parent
62988f04e0
commit
41c39284c5
7 files changed
+13
-4
No files matched your search
@@ -26,7 +26,11 @@ export default function gestureInit(art, events) {
|
||||
const ratioX = clamp((clientX - startX) / art.width, -1, 1);
|
||||
const ratioY = clamp((clientY - startY) / art.height, -1, 1);
|
||||
const ratio = autoOrientation ? ratioY : ratioX;
|
||||
const currentTime = clamp(startTime + (art.duration * ratio) / 2, 0, art.duration);
|
||||
const currentTime = clamp(
|
||||
startTime + art.duration * ratio * art.constructor.TOUCH_MOVE_RATIO,
|
||||
0,
|
||||
art.duration,
|
||||
);
|
||||
art.seek = currentTime;
|
||||
art.emit('setBar', 'played', clamp(currentTime / art.duration, 0, 1));
|
||||
art.notice.show = `${secondToTime(currentTime)} / ${secondToTime(art.duration)}`;
|
||||
|
||||
Reference in new issue
Block a user