Process "switchto" signaling message.

Signed-off-by: Ivan Sein <ivan@nextcloud.com>
This commit is contained in:
Ivan Sein 2023-01-31 14:37:37 +01:00
Родитель 55405efc51
Коммит b6112db73c
3 изменённых файлов: 18 добавлений и 0 удалений

Просмотреть файл

@ -854,6 +854,11 @@ static NSString * const kNCVideoTrackKind = @"video";
}];
}
- (void)externalSignalingController:(NCExternalSignalingController *)externalSignalingController shouldSwitchToCall:(NSString *)roomToken
{
[self willSwitchToCall:roomToken];
}
#pragma mark - Signaling Controller Delegate
- (void)signalingController:(NCSignalingController *)signalingController didReceiveSignalingMessage:(NSDictionary *)message

Просмотреть файл

@ -39,6 +39,7 @@ typedef enum NCExternalSignalingSendMessageStatus {
- (void)externalSignalingController:(NCExternalSignalingController *)externalSignalingController didReceivedParticipantListMessage:(NSDictionary *)participantListMessageDict;
- (void)externalSignalingControllerShouldRejoinCall:(NCExternalSignalingController *)externalSignalingController;
- (void)externalSignalingControllerWillRejoinCall:(NCExternalSignalingController *)externalSignalingController;
- (void)externalSignalingController:(NCExternalSignalingController *)externalSignalingController shouldSwitchToCall:(NSString *)roomToken;
@end

Просмотреть файл

@ -479,6 +479,8 @@ static NSTimeInterval kWebSocketTimeoutInterval = 15;
NSLog(@"Participant left room.");
} else if ([eventType isEqualToString:@"message"]) {
[self processRoomMessageEvent:[eventDict objectForKey:@"message"]];
} else if ([eventType isEqualToString:@"switchto"]) {
[self processSwitchToMessageEvent:[eventDict objectForKey:@"switchto"]];
} else {
NSLog(@"Unknown room event: %@", eventDict);
}
@ -496,6 +498,16 @@ static NSTimeInterval kWebSocketTimeoutInterval = 15;
}
}
- (void)processSwitchToMessageEvent:(NSDictionary *)messageDict
{
NSString *roomToken = [messageDict objectForKey:@"roomId"];
if (roomToken.length > 0) {
[self.delegate externalSignalingController:self shouldSwitchToCall:roomToken];
} else {
NSLog(@"Unknown switchTo message: %@", messageDict);
}
}
- (void)processRoomListEvent:(NSDictionary *)eventDict
{
NSLog(@"Refresh room list.");