liuzhenxing1118 7 сар өмнө
parent
commit
b59765f2a7

+ 1 - 0
artimenring-iOS/Artimenring/Classes/Data/VideoManager.h

@@ -49,6 +49,7 @@ typedef enum : NSUInteger {
 - (void)showInCallVC;
 - (void)removeInCallVC;
 
+- (BOOL)isVideoTalking;
 - (JCCallItem*)getActiveCall;
 - (NSString*)getTalkName;
 - (NSString*)getTalkHeadImageURL;

+ 5 - 0
artimenring-iOS/Artimenring/Classes/Data/VideoManager.m

@@ -148,6 +148,11 @@
     [self autoTerm];
 }
 
+- (BOOL)isVideoTalking {
+    JCCallItem *activeCall = [[VideoManager shared] getActiveCall];
+    return activeCall.video || activeCall.state == JCCallStateTalking;
+}
+
 - (JCCallItem*)getActiveCall {
     for (JCCallItem* item in self.mJuphoonCall.callItems) {
         if (item.active) {

+ 4 - 10
artimenring-iOS/Artimenring/Classes/ViewController/Call/SKInCallViewController+touch.m

@@ -12,8 +12,7 @@
 
 - (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {
     //如果不在通话
-    JCCallItem *activeCall = [[VideoManager shared] getActiveCall];
-    if (!activeCall.video && activeCall.state != JCCallStateTalking)
+    if (![[VideoManager shared] isVideoTalking])
         return;
     
     UITouch *touch = [touches anyObject];
@@ -32,8 +31,7 @@
 
 - (void)touchesMoved:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {
     //如果不在通话
-    JCCallItem *activeCall = [[VideoManager shared] getActiveCall];
-    if (!activeCall.video && activeCall.state != JCCallStateTalking)
+    if (![[VideoManager shared] isVideoTalking])
         return;
     
     if (!self.isTouchInSmallCanvas)
@@ -71,10 +69,8 @@
 
 - (void)touchesEnded:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {
     //如果不在通话
-    JCCallItem *activeCall = [[VideoManager shared] getActiveCall];
-    if (!activeCall.video && activeCall.state != JCCallStateTalking)
+    if (![[VideoManager shared] isVideoTalking])
         return;
-    
     self.isTouchInSmallCanvas = NO;
     self.isMoveInSmallCanvas = NO;
     self.mStartPoint = CGPointMake(0, 0);
@@ -82,10 +78,8 @@
 
 - (void)touchesCancelled:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {
     //如果不在通话
-    JCCallItem *activeCall = [[VideoManager shared] getActiveCall];
-    if (!activeCall.video && activeCall.state != JCCallStateTalking)
+    if (![[VideoManager shared] isVideoTalking])
         return;
-    
     self.isTouchInSmallCanvas = NO;
     self.isMoveInSmallCanvas = NO;
     self.mStartPoint = CGPointMake(0, 0);