mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-26 08:51:20 -08:00
add art.isRotate
This commit is contained in:
1 parent
1cbef4c6f4
commit
af6e936854
4 files changed
+5
-4
No files matched your search
@@ -21,11 +21,10 @@ export default function gestureInit(art, events) {
|
||||
|
||||
const onTouchMove = (event) => {
|
||||
if (event.touches.length === 1 && isDroging && art.duration) {
|
||||
const autoOrientation = art.plugins.autoOrientation && art.plugins.autoOrientation.state;
|
||||
const { clientX, clientY } = event.touches[0];
|
||||
const ratioX = clamp((clientX - startX) / art.width, -1, 1);
|
||||
const ratioY = clamp((clientY - startY) / art.height, -1, 1);
|
||||
const ratio = autoOrientation ? ratioY : ratioX;
|
||||
const ratio = art.isRotate ? ratioY : ratioX;
|
||||
const currentTime = clamp(
|
||||
startTime + art.duration * ratio * art.constructor.TOUCH_MOVE_RATIO,
|
||||
0,
|
||||
|
||||
Reference in new issue
Block a user