mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-05-30 04:58:41 +00:00
feat: pgc skip
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -682,6 +682,7 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
|
||||
final int quality = item.quality!;
|
||||
final newQa = VideoQuality.fromCode(quality);
|
||||
videoDetailController
|
||||
..plPlayerController.cacheVideoQa = newQa.code
|
||||
..currentVideoQa.value = newQa
|
||||
..updatePlayer();
|
||||
|
||||
@@ -1756,7 +1757,8 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
|
||||
|
||||
Obx(() {
|
||||
if (plPlayerController.dataStatus.loading ||
|
||||
plPlayerController.isBuffering.value) {
|
||||
(plPlayerController.isBuffering.value &&
|
||||
plPlayerController.playerStatus.playing)) {
|
||||
return Center(
|
||||
child: GestureDetector(
|
||||
onTap: plPlayerController.refreshPlayer,
|
||||
|
||||
Reference in New Issue
Block a user