SKInCallViewController.m 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. //
  2. // InCallViewController.m
  3. // JCSampleOC
  4. //
  5. // Created by Ginger on 2017/10/12.
  6. // Copyright © 2017年 juphoon. All rights reserved.
  7. //
  8. #import "SKInCallViewController.h"
  9. #import "SKInCallViewController+juphoon.h"
  10. #import "SKInCallViewController+agora.h"
  11. #import "SKInCallViewController+time.h"
  12. #import "SKInCallViewController+touch.h"
  13. #import "VideoManager+ringtone.h"
  14. @implementation SKInCallViewController
  15. - (void)viewDidLoad {
  16. [super viewDidLoad];
  17. [[UIApplication sharedApplication] setIdleTimerDisabled:YES];
  18. _smallView = nil;
  19. [self initView];
  20. [self initType];
  21. [[VideoManager shared] playVideoWaitingRingtone];
  22. }
  23. - (void)initView {
  24. [EUtil setViewShadow:self.mWaitNameLabel color:[UIColor colorWithRed:0/255.0f green:1/255.0f blue:75/255.0f alpha:0.2] offset:CGSizeMake(0, 2) opacity:1 radius:4];
  25. [EUtil setViewShadow:self.mWaitOutHintLabel color:[UIColor colorWithRed:0/255.0f green:1/255.0f blue:75/255.0f alpha:0.2] offset:CGSizeMake(0, 2) opacity:1 radius:4];
  26. [EUtil setViewShadow:self.mWaitInHintLabel color:[UIColor colorWithRed:0/255.0f green:1/255.0f blue:75/255.0f alpha:0.2] offset:CGSizeMake(0, 2) opacity:1 radius:4];
  27. [EUtil setViewShadow:self.mIngNameLabel color:[UIColor colorWithRed:0/255.0f green:1/255.0f blue:75/255.0f alpha:0.2] offset:CGSizeMake(0, 2) opacity:1 radius:4];
  28. [EUtil setViewShadow:self.mIngTimeLabel color:[UIColor colorWithRed:0/255.0f green:1/255.0f blue:75/255.0f alpha:0.2] offset:CGSizeMake(0, 2) opacity:1 radius:4];
  29. [EUtil setViewShadow:self.mIngNetWorkLabel color:[UIColor colorWithRed:0/255.0f green:1/255.0f blue:75/255.0f alpha:0.2] offset:CGSizeMake(0, 2) opacity:1 radius:4];
  30. [EUtil setURLImage:self.mWaitHeadImage placeHolderName:@"avatar" imageURL:[[VideoManager shared] getTalkHeadImageURL] cornerRadius:self.mWaitHeadImage.frame.size.width/2];
  31. }
  32. - (void)initType {
  33. if ([VideoManager shared].mVideoType == VIDEO_TYPE_JUPHOON) {
  34. [self updateJuphoonUI:nil];
  35. [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(updateJuphoonUI:) name:NOTIFICATION_JUPHOON object:nil];
  36. } else {
  37. [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(updateAgoraUI:) name:NOTIFICATION_AGORA object:nil];
  38. }
  39. }
  40. - (void)viewWillAppear:(BOOL)animated {
  41. [super viewWillAppear:animated];
  42. [self.navigationController setNavigationBarHidden:YES animated:NO];
  43. }
  44. - (void)viewWillDisappear:(BOOL)animated {
  45. [super viewWillDisappear:animated];
  46. [self.navigationController setNavigationBarHidden:NO animated:NO];
  47. [self stopTimer];
  48. self.mIngTimeLabel.text = @"";
  49. self.mIngNetWorkLabel.text = @"";
  50. }
  51. - (UIInterfaceOrientationMask)supportedInterfaceOrientations {
  52. return UIInterfaceOrientationMaskPortrait;
  53. }
  54. - (void)dealloc {
  55. [[NSNotificationCenter defaultCenter] removeObserver:self];
  56. [[UIApplication sharedApplication] setIdleTimerDisabled:NO];
  57. [[VideoManager shared] playVideoFinishRingtone];
  58. }
  59. #pragma mark - Incoming Actions
  60. - (IBAction)endCall:(id)sender {
  61. //通话中挂断; 自己发起时,对方未接通,自己挂断//
  62. [[VideoManager shared] videoEnd:NO isSendMessage:YES];
  63. }
  64. - (IBAction)endCallWhenIncoming:(id)sender {
  65. //对方发起时,自己拒接//
  66. [[VideoManager shared] videoEnd:YES isSendMessage:YES];
  67. }
  68. - (IBAction)voiceAnswer:(id)sender {
  69. }
  70. - (IBAction)videoAnswer:(id)sender {
  71. [[VideoManager shared] videoAnswer];
  72. }
  73. #pragma mark - In Calling Actions
  74. - (IBAction)setCameraState:(id)sender {
  75. }
  76. - (IBAction)addNewCall:(id)sender {
  77. }
  78. - (IBAction)switchCamera:(id)sender {
  79. [[VideoManager shared] switchCamera];
  80. }
  81. - (IBAction)hold:(id)sender {
  82. }
  83. - (IBAction)mute:(id)sender {
  84. }
  85. - (IBAction)audioRecord:(id)sender {
  86. }
  87. - (IBAction)videoRecord:(id)sender {
  88. }
  89. - (IBAction)snapshot:(id)sender {
  90. }
  91. - (IBAction)speaker:(id)sender {
  92. }
  93. - (IBAction)callStatistics:(id)sender {
  94. }
  95. @end