mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-21 04:31:20 -08:00
update touchmove event
This commit is contained in:
1 parent
49aedb0026
commit
3a3c21e059
3 files changed
+17
-11
No files matched your search
@@ -3917,11 +3917,14 @@
|
||||
}
|
||||
});
|
||||
events.proxy($video, 'touchmove', function (event) {
|
||||
if (event.touches.length === 1 && isDroging && art.duration) {
|
||||
var widthDiff = event.touches[0].clientX - startX;
|
||||
var proportion = clamp(widthDiff / $video.clientWidth, -1, 1);
|
||||
currentTime = clamp(art.currentTime + art.duration * proportion, 0, art.duration);
|
||||
notice.show = "".concat(secondToTime(currentTime), " / ").concat(secondToTime(art.duration));
|
||||
if (event.touches.length === 1 && isDroging) {
|
||||
var clientX = event.touches[0].clientX;
|
||||
var ratioX = clamp((clientX - startX) / $video.clientWidth, -1, 1);
|
||||
|
||||
if (art.duration) {
|
||||
currentTime = clamp(art.currentTime + art.duration * ratioX, 0, art.duration);
|
||||
notice.show = "".concat(secondToTime(currentTime), " / ").concat(secondToTime(art.duration));
|
||||
}
|
||||
}
|
||||
});
|
||||
events.proxy(document, 'touchend', function () {
|
||||
|
||||
Reference in new issue
Block a user