зеркало из https://github.com/nextcloud/talk-ios.git
Check if external signaling server has a MCU.
Signed-off-by: Ivan Sein <ivan@nextcloud.com>
This commit is contained in:
Родитель
ed09521b75
Коммит
6249fd6868
|
@ -98,7 +98,9 @@ static NSString * const kNCVideoTrackKind = @"video";
|
||||||
[self startMonitoringMicrophoneAudioLevel];
|
[self startMonitoringMicrophoneAudioLevel];
|
||||||
if ([[NCExternalSignalingController sharedInstance] isEnabled]) {
|
if ([[NCExternalSignalingController sharedInstance] isEnabled]) {
|
||||||
_userSessionId = [[NCExternalSignalingController sharedInstance] sessionId];
|
_userSessionId = [[NCExternalSignalingController sharedInstance] sessionId];
|
||||||
[self createOwnPublishPeerConnection];
|
if ([[NCExternalSignalingController sharedInstance] hasMCU]) {
|
||||||
|
[self createOwnPublishPeerConnection];
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
[_signalingController startPullingSignalingMessages];
|
[_signalingController startPullingSignalingMessages];
|
||||||
}
|
}
|
||||||
|
@ -336,7 +338,7 @@ static NSString * const kNCVideoTrackKind = @"video";
|
||||||
peerConnectionWrapper = [[NCPeerConnection alloc] initWithSessionId:sessionId andICEServers:iceServers forAudioOnlyCall:_isAudioOnly];
|
peerConnectionWrapper = [[NCPeerConnection alloc] initWithSessionId:sessionId andICEServers:iceServers forAudioOnlyCall:_isAudioOnly];
|
||||||
peerConnectionWrapper.delegate = self;
|
peerConnectionWrapper.delegate = self;
|
||||||
// TODO: Try to get display name here
|
// TODO: Try to get display name here
|
||||||
if (![[NCExternalSignalingController sharedInstance] isEnabled]) {
|
if (![[NCExternalSignalingController sharedInstance] hasMCU]) {
|
||||||
[peerConnectionWrapper.peerConnection addStream:_localStream];
|
[peerConnectionWrapper.peerConnection addStream:_localStream];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -469,7 +471,7 @@ static NSString * const kNCVideoTrackKind = @"video";
|
||||||
|
|
||||||
for (NSString *sessionId in newSessions) {
|
for (NSString *sessionId in newSessions) {
|
||||||
if (![_connectionsDict objectForKey:sessionId]) {
|
if (![_connectionsDict objectForKey:sessionId]) {
|
||||||
if ([[NCExternalSignalingController sharedInstance] isEnabled]) {
|
if ([[NCExternalSignalingController sharedInstance] hasMCU]) {
|
||||||
NSLog(@"Requesting offer to the MCU");
|
NSLog(@"Requesting offer to the MCU");
|
||||||
[[NCExternalSignalingController sharedInstance] requestOfferForSessionId:sessionId andRoomType:@"video"];
|
[[NCExternalSignalingController sharedInstance] requestOfferForSessionId:sessionId andRoomType:@"video"];
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -17,6 +17,7 @@ extern NSString * const NCESReceivedParticipantListMessageNotification;
|
||||||
|
|
||||||
+ (instancetype)sharedInstance;
|
+ (instancetype)sharedInstance;
|
||||||
- (BOOL)isEnabled;
|
- (BOOL)isEnabled;
|
||||||
|
- (BOOL)hasMCU;
|
||||||
- (NSString *)sessionId;
|
- (NSString *)sessionId;
|
||||||
- (void)setServer:(NSString *)serverUrl andTicket:(NSString *)ticket;
|
- (void)setServer:(NSString *)serverUrl andTicket:(NSString *)ticket;
|
||||||
- (void)joinRoom:(NSString *)roomId withSessionId:(NSString *)sessionId;
|
- (void)joinRoom:(NSString *)roomId withSessionId:(NSString *)sessionId;
|
||||||
|
|
|
@ -50,6 +50,11 @@ NSString * const NCESReceivedParticipantListMessageNotification = @"NCESReceived
|
||||||
return (_serverUrl) ? YES : NO;
|
return (_serverUrl) ? YES : NO;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (BOOL)hasMCU
|
||||||
|
{
|
||||||
|
return _mcuSupport;
|
||||||
|
}
|
||||||
|
|
||||||
- (NSString *)sessionId
|
- (NSString *)sessionId
|
||||||
{
|
{
|
||||||
return _sessionId;
|
return _sessionId;
|
||||||
|
@ -173,7 +178,12 @@ NSString * const NCESReceivedParticipantListMessageNotification = @"NCESReceived
|
||||||
- (void)helloResponseReceived:(NSDictionary *)helloDict
|
- (void)helloResponseReceived:(NSDictionary *)helloDict
|
||||||
{
|
{
|
||||||
_resumeId = [helloDict objectForKey:@"resumeid"];
|
_resumeId = [helloDict objectForKey:@"resumeid"];
|
||||||
// Get server features
|
NSArray *serverFeatures = [[helloDict objectForKey:@"server"] objectForKey:@"features"];
|
||||||
|
for (NSString *feature in serverFeatures) {
|
||||||
|
if ([feature isEqualToString:@"mcu"]) {
|
||||||
|
_mcuSupport = YES;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)errorResponseReceived:(NSDictionary *)errorDict
|
- (void)errorResponseReceived:(NSDictionary *)errorDict
|
||||||
|
|
Загрузка…
Ссылка в новой задаче