处理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

@@ -135,9 +135,13 @@ typedef NS_ENUM(NSInteger, KBGuideItemType) {
[self kb_preparePermissionOverlayIfNeeded]; [self kb_preparePermissionOverlayIfNeeded];
BOOL show = needGuide; BOOL show = needGuide;
// [UIView performWithoutAnimation:^{ // /
self.permVC.view.hidden = !show; self.permVC.view.hidden = !show;
// }]; if (show) {
[self.permVC kb_resumeGuideVideoIfNeeded];
} else {
[self.permVC kb_pauseGuideVideo];
}
// //
// 便/访 // 便/访

View File

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

View File

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