mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-23 05:41:20 -08:00
update gestureInit
This commit is contained in:
1 parent
f4ade95551
commit
e4f815e24f
3 files changed
+8
-8
No files matched your search
@@ -30,7 +30,7 @@ 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, 0, art.duration);
|
||||
const currentTime = clamp(startTime + (art.duration * ratio) / 2, 0, art.duration);
|
||||
art.seek = currentTime;
|
||||
art.emit('setBar', 'played', clamp(currentTime / art.duration, 0, 1));
|
||||
notice.show = `${secondToTime(currentTime)} / ${secondToTime(art.duration)}`;
|
||||
|
||||
Reference in new issue
Block a user