mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-26 17:01:20 -08:00
4.3.6
This commit is contained in:
1 parent
225eea4158
commit
92393357c7
4 files changed
+7
-7
No files matched your search
@@ -1,7 +1,7 @@
|
||||
import { clamp, secondToTime, isMobile } from '../utils';
|
||||
|
||||
export default function gestureInit(art, events) {
|
||||
if (isMobile && !art.option.isLive && art.duration) {
|
||||
if (isMobile && !art.option.isLive) {
|
||||
const {
|
||||
notice,
|
||||
template: { $video },
|
||||
@@ -25,7 +25,7 @@ export default function gestureInit(art, events) {
|
||||
});
|
||||
|
||||
events.proxy($video, 'touchmove', (event) => {
|
||||
if (event.touches.length === 1 && isDroging) {
|
||||
if (event.touches.length === 1 && isDroging && art.duration) {
|
||||
const widthDiff = event.touches[0].clientX - startX;
|
||||
const proportion = clamp(widthDiff / $video.clientWidth, -1, 1);
|
||||
currentTime = clamp(art.currentTime + art.duration * proportion, 0, art.duration);
|
||||
|
||||
Reference in new issue
Block a user