feat: pgc skip

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-10-08 21:22:02 +08:00
parent 06d8296939
commit ca0eb1716f
13 changed files with 232 additions and 94 deletions

View File

@@ -361,8 +361,10 @@ class PlPlayerController {
late double subtitleStrokeWidth = Pref.subtitleStrokeWidth;
late int subtitleFontWeight = Pref.subtitleFontWeight;
late final pgcSkipType = Pref.pgcSkipType;
late final enablePgcSkip = Pref.pgcSkipType != SkipType.disable;
// sponsor block
late final bool enableSponsorBlock = Pref.enableSponsorBlock;
late final bool enableSponsorBlock = Pref.enableSponsorBlock || enablePgcSkip;
late final double blockLimit = Pref.blockLimit;
late final blockSettings = Pref.blockSettings;
late final List<Color> blockColor = Pref.blockColor;
@@ -1253,14 +1255,12 @@ class PlPlayerController {
/// 暂停播放
Future<void> pause({bool notify = true, bool isInterrupt = false}) async {
if (videoPlayerController?.state.playing ?? false) {
await _videoPlayerController?.playOrPause();
playerStatus.status.value = PlayerStatus.paused;
await _videoPlayerController?.pause();
playerStatus.status.value = PlayerStatus.paused;
// 主动暂停时让出音频焦点
if (!isInterrupt) {
audioSessionHandler?.setActive(false);
}
// 主动暂停时让出音频焦点
if (!isInterrupt) {
audioSessionHandler?.setActive(false);
}
}