|
@@ -48,10 +48,10 @@
|
|
- (void)videoCallIn {
|
|
- (void)videoCallIn {
|
|
HDNormalLog(@"VideoManager videoCallIn");
|
|
HDNormalLog(@"VideoManager videoCallIn");
|
|
DeviceModel* model = [[DataManager shared]getDeviceWithTicket:self.mTicket];
|
|
DeviceModel* model = [[DataManager shared]getDeviceWithTicket:self.mTicket];
|
|
- if (model.videoType == VIDEO_TYPE_JUPHOON) {
|
|
|
|
|
|
+ if (model.videoCallChannel == VIDEO_TYPE_JUPHOON) {
|
|
[self loginJuphoon];
|
|
[self loginJuphoon];
|
|
- } else if (model.videoType == VIDEO_TYPE_AGORA) {
|
|
|
|
- [self showInCallVC:model.videoType isCallIn:YES];
|
|
|
|
|
|
+ } else if (model.videoCallChannel == VIDEO_TYPE_AGORA) {
|
|
|
|
+ [self showInCallVC:model.videoCallChannel isCallIn:YES];
|
|
[self startTimeoutTimer];
|
|
[self startTimeoutTimer];
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -69,9 +69,9 @@
|
|
return;
|
|
return;
|
|
self.uid = uid;
|
|
self.uid = uid;
|
|
self.mTicket = ticket;
|
|
self.mTicket = ticket;
|
|
- self.roomId = model.videoType == VIDEO_TYPE_JUPHOON ? ticket : [self getRoomId:self.uid ticket:self.mTicket];
|
|
|
|
|
|
+ self.roomId = model.videoCallChannel == VIDEO_TYPE_JUPHOON ? ticket : [self getRoomId:self.uid ticket:self.mTicket];
|
|
|
|
|
|
- if (model.videoType == VIDEO_TYPE_JUPHOON) {
|
|
|
|
|
|
+ if (model.videoCallChannel == VIDEO_TYPE_JUPHOON) {
|
|
BOOL isok = [self call:uid ticket:ticket];
|
|
BOOL isok = [self call:uid ticket:ticket];
|
|
if (!isok) {
|
|
if (!isok) {
|
|
//如果失败,很有可能登录失败,重新登录//
|
|
//如果失败,很有可能登录失败,重新登录//
|
|
@@ -82,11 +82,11 @@
|
|
}];
|
|
}];
|
|
[self startTimeoutTimer];
|
|
[self startTimeoutTimer];
|
|
}
|
|
}
|
|
- } else if (model.videoType == VIDEO_TYPE_AGORA) {
|
|
|
|
|
|
+ } else if (model.videoCallChannel == VIDEO_TYPE_AGORA) {
|
|
[self requestVideo:uid ticket:ticket dial:1 callback:^(BOOL isOK, NSString *token) {
|
|
[self requestVideo:uid ticket:ticket dial:1 callback:^(BOOL isOK, NSString *token) {
|
|
if (isOK && token.length > 0) {
|
|
if (isOK && token.length > 0) {
|
|
self.mToken = token;
|
|
self.mToken = token;
|
|
- [weak_self showInCallVC:model.videoType isCallIn:NO];
|
|
|
|
|
|
+ [weak_self showInCallVC:model.videoCallChannel isCallIn:NO];
|
|
[weak_self startTimeoutTimer];
|
|
[weak_self startTimeoutTimer];
|
|
}
|
|
}
|
|
}];
|
|
}];
|
|
@@ -96,9 +96,9 @@
|
|
- (void)videoAnswer {
|
|
- (void)videoAnswer {
|
|
HDNormalLog(@"VideoManager videoAnswer");
|
|
HDNormalLog(@"VideoManager videoAnswer");
|
|
DeviceModel* model = [[DataManager shared]getDeviceWithTicket:self.mTicket];
|
|
DeviceModel* model = [[DataManager shared]getDeviceWithTicket:self.mTicket];
|
|
- if (model.videoType == VIDEO_TYPE_JUPHOON) {
|
|
|
|
|
|
+ if (model.videoCallChannel == VIDEO_TYPE_JUPHOON) {
|
|
[self answerJuphoon];
|
|
[self answerJuphoon];
|
|
- } else if (model.videoType == VIDEO_TYPE_AGORA) {
|
|
|
|
|
|
+ } else if (model.videoCallChannel == VIDEO_TYPE_AGORA) {
|
|
[self joinChannel:self.mToken channelId:self.roomId uid:0];
|
|
[self joinChannel:self.mToken channelId:self.roomId uid:0];
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -128,10 +128,10 @@
|
|
|
|
|
|
- (void)term {
|
|
- (void)term {
|
|
DeviceModel* model = [[DataManager shared] getDeviceWithTicket:self.mTicket];
|
|
DeviceModel* model = [[DataManager shared] getDeviceWithTicket:self.mTicket];
|
|
- if (model.videoType == VIDEO_TYPE_JUPHOON) {
|
|
|
|
|
|
+ if (model.videoCallChannel == VIDEO_TYPE_JUPHOON) {
|
|
[self termJuphoon];
|
|
[self termJuphoon];
|
|
[self removeInCallVC];
|
|
[self removeInCallVC];
|
|
- } else if (model.videoType == VIDEO_TYPE_AGORA) {
|
|
|
|
|
|
+ } else if (model.videoCallChannel == VIDEO_TYPE_AGORA) {
|
|
[self termAgora];
|
|
[self termAgora];
|
|
[self removeInCallVC];
|
|
[self removeInCallVC];
|
|
}
|
|
}
|
|
@@ -140,9 +140,9 @@
|
|
|
|
|
|
- (void)switchCamera {
|
|
- (void)switchCamera {
|
|
DeviceModel* model = [[DataManager shared] getDeviceWithTicket:self.mTicket];
|
|
DeviceModel* model = [[DataManager shared] getDeviceWithTicket:self.mTicket];
|
|
- if (model.videoType == VIDEO_TYPE_JUPHOON) {
|
|
|
|
|
|
+ if (model.videoCallChannel == VIDEO_TYPE_JUPHOON) {
|
|
[self switchCameraJuphoon];
|
|
[self switchCameraJuphoon];
|
|
- } else if (model.videoType == VIDEO_TYPE_AGORA) {
|
|
|
|
|
|
+ } else if (model.videoCallChannel == VIDEO_TYPE_AGORA) {
|
|
[self switchCameraAgora];
|
|
[self switchCameraAgora];
|
|
}
|
|
}
|
|
}
|
|
}
|