webRtcPlayerViewController+AppDelegate.m 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. //
  2. // webRtcPlayerViewController+AppDelegate.m
  3. // 双子星云手机
  4. //
  5. // Created by xd h on 2024/9/18.
  6. //
  7. #import "webRtcPlayerViewController+AppDelegate.h"
  8. @implementation webRtcPlayerViewController (AppDelegate)
  9. #pragma mark - UIApplication Delegate
  10. - (void)applicationWillResignActive:(NSNotification *)notification
  11. {
  12. //HLog(@"11111");
  13. }
  14. - (void)applicationDidEnterBackground:(NSNotification *)notification {
  15. // app进入后台时
  16. [self pauseStream];
  17. }
  18. - (void)applicationDidBecomeActive:(NSNotification *)notification
  19. {
  20. if(!ksharedAppDelegate.isDidShowPwdType){
  21. [self resumeStream];
  22. }
  23. }
  24. - (void)applicationWillTerminate:(UIApplication *)application {
  25. // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
  26. [self.mediaStream disconnect];
  27. }
  28. #pragma mark 云机停止拉流
  29. - (void)pauseStream
  30. {
  31. [self.mediaStream pauseStream];
  32. }
  33. #pragma mark 云机唤醒拉流
  34. - (void)resumeStream
  35. {
  36. [self.mediaStream resumeStream];
  37. }
  38. #pragma mark 输入密码完成
  39. - (void)didInpuPwdOkFun
  40. {
  41. [self resumeStream];
  42. }
  43. @end