// // webRtcPlayerViewController+AppDelegate.m // 双子星云手机 // // Created by xd h on 2024/9/18. // #import "webRtcPlayerViewController+AppDelegate.h" @implementation webRtcPlayerViewController (AppDelegate) #pragma mark - UIApplication Delegate - (void)applicationWillResignActive:(NSNotification *)notification { //HLog(@"11111"); } - (void)applicationDidEnterBackground:(NSNotification *)notification { // app进入后台时 [self pauseStream]; [self checkLanAndPrivacyModeTypeFun]; } - (void)applicationDidBecomeActive:(NSNotification *)notification { if(!ksharedAppDelegate.isDidShowPwdType){ [self resumeStream]; } } - (void)applicationWillTerminate:(UIApplication *)application { // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. [self.mediaStream disconnect]; } #pragma mark 云机停止拉流 - (void)pauseStream { [self.mediaStream pauseStream]; } #pragma mark 云机唤醒拉流 - (void)resumeStream { [self.mediaStream resumeStream]; } #pragma mark 检测是否为横屏而且 隐私模式 (密码界面只有竖屏 UI会乱) - (void)checkLanAndPrivacyModeTypeFun { if(!self->isLan){ return; } if(!ksharedAppDelegate.DeviceThirdIdMod.data.isPrivacyMode){ return; } self->isLan = YES; self->isLanAndPrivacyEnterBackground = YES; //旋转屏幕为竖屏 (已经在sceneDelegate 处理旋转) HLog(@"旋转屏幕为竖屏 (已经在sceneDelegate 处理旋转)") } #pragma mark 输入密码完成 - (void)didInpuPwdOkFun { [self resumeStream]; if(self->isLanAndPrivacyEnterBackground){ self->isLanAndPrivacyEnterBackground = NO; ksharedAppDelegate.supportScreenRotateType = YES; [self hx_rotateToInterfaceOrientation:UIInterfaceOrientationLandscapeRight]; HLog(@"旋转屏幕为横屏") } } @end