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模式下禁用
void setDoubleSpeedStatus(bool val) {
void setDoubleSpeedStatus(bool val) async {
if (videoType.value == 'live') {
return;
}
@@ -1137,11 +1137,11 @@ class PlPlayerController {
}
_doubleSpeedStatus.value = val;
if (val) {
setPlaybackSpeed(
await setPlaybackSpeed(
enableAutoLongPressSpeed ? playbackSpeed * 2 : longPressSpeed);
} else {
print(playbackSpeed);
setPlaybackSpeed(playbackSpeed);
await setPlaybackSpeed(playbackSpeed);
}
}

View File

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