mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-08 19:06:15 -08:00
set right playbackrate after fastforward on mobile
This commit is contained in:
1 parent
2cf2a464b9
commit
07c206ab89
1 file changed
+3
-1
@@ -9,11 +9,13 @@ export default function fastForward(art) {
|
||||
|
||||
let timer = null;
|
||||
let isPress = false;
|
||||
let lastPlaybackRate = 1;
|
||||
|
||||
const onStart = (event) => {
|
||||
if (event.touches.length === 1 && art.playing && !art.isLock) {
|
||||
timer = setTimeout(() => {
|
||||
isPress = true;
|
||||
lastPlaybackRate = art.playbackRate;
|
||||
art.playbackRate = constructor.FAST_FORWARD_VALUE;
|
||||
addClass($player, 'art-fast-forward');
|
||||
}, constructor.FAST_FORWARD_TIME);
|
||||
@@ -24,7 +26,7 @@ export default function fastForward(art) {
|
||||
clearTimeout(timer);
|
||||
if (isPress) {
|
||||
isPress = false;
|
||||
art.playbackRate = 1;
|
||||
art.playbackRate = lastPlaybackRate;
|
||||
removeClass($player, 'art-fast-forward');
|
||||
}
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user