fix: 恢复亮度关闭时仍会改变亮度;听视频状态下调节进度无效

This commit is contained in:
orz12
2024-08-25 23:55:56 +08:00
parent a51aa1ce13
commit eaf12d8e9e
3 changed files with 19 additions and 21 deletions

View File

@@ -895,13 +895,18 @@ class PlPlayerController {
await _videoPlayerController?.play();
await getCurrentVolume();
await getCurrentBrightness();
playerStatus.status.value = PlayerStatus.playing;
// screenManager.setOverlays(false);
audioSessionHandler.setActive(true);
Future.delayed(const Duration(milliseconds: 100), () {
getCurrentVolume();
if (setting.get(SettingBoxKey.enableAutoBrightness, defaultValue: false)
as bool) {
getCurrentBrightness();
}
});
}
/// 暂停播放
@@ -1313,7 +1318,10 @@ class PlPlayerController {
}
_instance = null;
// 关闭所有视频页面恢复亮度
resetBrightness();
if (setting.get(SettingBoxKey.enableAutoBrightness, defaultValue: false)
as bool) {
resetBrightness();
}
videoPlayerServiceHandler.clear();
} catch (err) {
print(err);