Explorar o código

单独出video socket

liuzhenxing1118 hai 7 meses
pai
achega
6a919e4e1d

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

@@ -0,0 +1,19 @@
+//
+//  VideoManager+socket.h
+//  SikeyComm
+//
+//  Created by 刘振兴 on 2025/2/20.
+//  Copyright © 2025 BaH Cy. All rights reserved.
+//
+
+
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface VideoManager (socket)
+
+- (void)actionFromSocket:(SocketModel*)model dial:(NSInteger)dial;
+
+@end
+
+NS_ASSUME_NONNULL_END

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

@@ -0,0 +1,31 @@
+//
+//  VideoManager+socket.m
+//  SikeyComm
+//
+//  Created by 刘振兴 on 2025/2/20.
+//  Copyright © 2025 BaH Cy. All rights reserved.
+//
+
+#import "VideoManager+socket.h"
+
+@implementation VideoManager (socket)
+
+- (void)actionFromSocket:(SocketModel*)model dial:(NSInteger)dial {
+    ChildModel* childModel = [[DataManager shared] getChildWithTicket:self.mTicket];
+    BOOL isEquel = [model.sendId isEqualToString:childModel.cid];
+    
+    if (dial <= 0) {
+        if (isEquel) {
+            [EasyTextView showInfoText:NSLocalizedString(@"Video.Error.Hangup", nil)];
+            [self term];
+        }
+    } else {
+        self.uid = [DataManager shared].loginModel.uid;
+        self.mTicket = [[DataManager shared] getDevice:model.sendId].ticket;
+        self.mToken = ((SocketContentModel*)model.content).token;
+        self.mChannelName = ((SocketContentModel*)model.content).channelName;
+        [self videoCallIn];
+    }
+}
+
+@end

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

@@ -44,13 +44,12 @@ NS_ASSUME_NONNULL_BEGIN
 - (void)initManager;
 - (void)clear;
 
+- (void)videoCallIn;
 - (void)videoCallOut:(NSString*)uid ticket:(NSString*)ticket;
 - (void)videoEnd:(BOOL)isCallIn isSendMessage:(BOOL)isSendMessage;
 - (void)videoAnswer;
 - (void)switchCamera;
 
-- (void)actionFromSocket:(SocketModel*)model dial:(NSInteger)dial;
-
 - (void)term;
 - (void)termWithTimeout;
 

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

@@ -34,24 +34,6 @@
     [self clearAgora];
 }
 
-#pragma mark -
-- (void)actionFromSocket:(SocketModel*)model dial:(NSInteger)dial {
-    if (dial <= 0) {
-        ChildModel* childModel = [[DataManager shared] getChildWithTicket:self.mTicket];
-        BOOL isEquel = [model.sendId isEqualToString:childModel.cid];
-        if (isEquel) {
-            [EasyTextView showInfoText:NSLocalizedString(@"Video.Error.Hangup", nil)];
-            [self term];
-        }
-    } else {
-        self.uid = [DataManager shared].loginModel.uid;
-        self.mTicket = [[DataManager shared] getDevice:model.sendId].ticket;
-        self.mToken = ((SocketContentModel*)model.content).token;
-        self.mChannelName = ((SocketContentModel*)model.content).channelName;
-        [self videoCallIn];
-    }
-}
-
 - (void)videoCallIn {
     DeviceModel* model = [[DataManager shared]getDeviceWithTicket:self.mTicket];
     if (model.videoType == VIDEO_TYPE_JUPHOON) {

+ 1 - 0
artimenring-iOS/Artimenring/Classes/Socket/SKPushMessage.m

@@ -10,6 +10,7 @@
 #import "PopupView.h"
 #import "SKWebViewViewController.h"
 #import "SKWebSocket+queue.h"
+#import "VideoManager+socket.h"
 
 @implementation SKPushMessage
 

+ 6 - 0
artimenring-iOS/SikeyComm.xcodeproj/project.pbxproj

@@ -182,6 +182,7 @@
 		E41849612B8C8CCB000C18DB /* SKAlarmClockTitleViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E41849602B8C8CCB000C18DB /* SKAlarmClockTitleViewController.m */; };
 		E418538B2D64745B00F9C739 /* VideoManager+http.m in Sources */ = {isa = PBXBuildFile; fileRef = E418538A2D64745B00F9C739 /* VideoManager+http.m */; };
 		E418538E2D64767100F9C739 /* VideoManager+view.m in Sources */ = {isa = PBXBuildFile; fileRef = E418538D2D64767100F9C739 /* VideoManager+view.m */; };
+		E41853912D66FCAA00F9C739 /* VideoManager+socket.m in Sources */ = {isa = PBXBuildFile; fileRef = E41853902D66FCAA00F9C739 /* VideoManager+socket.m */; };
 		E41ECB5C2CF95C6C00C4C36C /* SKMainViewController+location.m in Sources */ = {isa = PBXBuildFile; fileRef = E41ECB4C2CF95C6B00C4C36C /* SKMainViewController+location.m */; };
 		E41ECB5D2CF95C6C00C4C36C /* SKMainViewController+realpos.m in Sources */ = {isa = PBXBuildFile; fileRef = E41ECB4D2CF95C6B00C4C36C /* SKMainViewController+realpos.m */; };
 		E41ECB5E2CF95C6C00C4C36C /* SKMainViewController+banner.m in Sources */ = {isa = PBXBuildFile; fileRef = E41ECB4E2CF95C6B00C4C36C /* SKMainViewController+banner.m */; };
@@ -713,6 +714,8 @@
 		E418538A2D64745B00F9C739 /* VideoManager+http.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "VideoManager+http.m"; sourceTree = "<group>"; };
 		E418538C2D64767100F9C739 /* VideoManager+view.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "VideoManager+view.h"; sourceTree = "<group>"; };
 		E418538D2D64767100F9C739 /* VideoManager+view.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "VideoManager+view.m"; sourceTree = "<group>"; };
+		E418538F2D66FCAA00F9C739 /* VideoManager+socket.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "VideoManager+socket.h"; sourceTree = "<group>"; };
+		E41853902D66FCAA00F9C739 /* VideoManager+socket.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "VideoManager+socket.m"; sourceTree = "<group>"; };
 		E41ECB4C2CF95C6B00C4C36C /* SKMainViewController+location.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "SKMainViewController+location.m"; sourceTree = "<group>"; };
 		E41ECB4D2CF95C6B00C4C36C /* SKMainViewController+realpos.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "SKMainViewController+realpos.m"; sourceTree = "<group>"; };
 		E41ECB4E2CF95C6B00C4C36C /* SKMainViewController+banner.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "SKMainViewController+banner.m"; sourceTree = "<group>"; };
@@ -2410,6 +2413,8 @@
 				E4499A932D5DDFEA00653B56 /* VideoManager+juphoon.m */,
 				E4499A7E2D5B4DF000653B56 /* VideoManager+ringtone.h */,
 				E4499A7F2D5B4DF000653B56 /* VideoManager+ringtone.m */,
+				E418538F2D66FCAA00F9C739 /* VideoManager+socket.h */,
+				E41853902D66FCAA00F9C739 /* VideoManager+socket.m */,
 				E4499A802D5B4DF000653B56 /* VideoManager+timer.h */,
 				E4499A812D5B4DF000653B56 /* VideoManager+timer.m */,
 				E418538C2D64767100F9C739 /* VideoManager+view.h */,
@@ -3126,6 +3131,7 @@
 				E55F0A9F1B1055AF0093BF6B /* UIViewController+Keyboard.m in Sources */,
 				271CD1712004A1300060C574 /* ConfimMessageViewController.m in Sources */,
 				27C621AE1F3C372B00C2B7A3 /* MagicAcademyWeekdayViewController.m in Sources */,
+				E41853912D66FCAA00F9C739 /* VideoManager+socket.m in Sources */,
 				285CF0841A442CCE00CDB5FE /* EModel.m in Sources */,
 				E4E75FBE2B9F1C6100236F73 /* PGCustomBannerView.m in Sources */,
 				E4E75FDA2BA06FFE00236F73 /* WeatherWarnView.m in Sources */,