处理bug

This commit is contained in:
2025-11-28 14:25:13 +08:00
parent d4c553f072
commit 9268a21eb8
3 changed files with 24 additions and 5 deletions

View File

@@ -16,6 +16,10 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic, copy, nullable) void (^backHandler)(void);
@property (nonatomic, strong) UIButton *backButton; // 左上角返回
/// 外部(如 KBGuideVC根据引导页是否显示控制视频播放/暂停
- (void)kb_resumeGuideVideoIfNeeded;
- (void)kb_pauseGuideVideo;
@end
NS_ASSUME_NONNULL_END

View File

@@ -108,8 +108,10 @@ static void *KBPermPlayerPresentationSizeContext = &KBPermPlayerPresentationSize
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
//
[self kb_setupPermissionVideoPlayer];
//
if (!self.view.hidden) {
[self kb_setupPermissionVideoPlayer];
}
}
- (void)viewDidDisappear:(BOOL)animated {
@@ -249,6 +251,15 @@ static void *KBPermPlayerPresentationSizeContext = &KBPermPlayerPresentationSize
[self.kb_permPlayer play];
}
- (void)kb_resumeGuideVideoIfNeeded {
//
[self kb_setupPermissionVideoPlayer];
}
- (void)kb_pauseGuideVideo {
[self.kb_permPlayer pause];
}
- (void)kb_playerItemDidReachEnd:(NSNotification *)note {
AVPlayerItem *item = (AVPlayerItem *)note.object;
if (!item) return;