opt: 减少长按倍速卡顿的情况(玄学)

This commit is contained in:
orz12
2024-08-18 17:10:25 +08:00
parent 0d3e62b16a
commit db703907f5
2 changed files with 4 additions and 4 deletions

View File

@@ -1128,7 +1128,7 @@ class PlPlayerController {
} }
/// 设置长按倍速状态 live模式下禁用 /// 设置长按倍速状态 live模式下禁用
void setDoubleSpeedStatus(bool val) { void setDoubleSpeedStatus(bool val) async {
if (videoType.value == 'live') { if (videoType.value == 'live') {
return; return;
} }
@@ -1137,11 +1137,11 @@ class PlPlayerController {
} }
_doubleSpeedStatus.value = val; _doubleSpeedStatus.value = val;
if (val) { if (val) {
setPlaybackSpeed( await setPlaybackSpeed(
enableAutoLongPressSpeed ? playbackSpeed * 2 : longPressSpeed); enableAutoLongPressSpeed ? playbackSpeed * 2 : longPressSpeed);
} else { } else {
print(playbackSpeed); print(playbackSpeed);
setPlaybackSpeed(playbackSpeed); await setPlaybackSpeed(playbackSpeed);
} }
} }

View File

@@ -901,8 +901,8 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
doubleTapFuc(type); doubleTapFuc(type);
}, },
onLongPressStart: (LongPressStartDetails detail) { onLongPressStart: (LongPressStartDetails detail) {
feedBack();
_.setDoubleSpeedStatus(true); _.setDoubleSpeedStatus(true);
feedBack();
}, },
onLongPressEnd: (LongPressEndDetails details) { onLongPressEnd: (LongPressEndDetails details) {
_.setDoubleSpeedStatus(false); _.setDoubleSpeedStatus(false);