Suggestions

close search

Upgrade an audio call to video call

You can upgrade an audio call to a video call by calling the enableLocalVideo(YES) method of the StringeeCall object:

[stringeeCall enableLocalVideo:YES];

Stringee also provides APIs to make it easy to send an upgrade request from a client to another. Follow the instructions below to implement a full upgrade flow:

1. Client A and client B is on an audio call.

2. Client A calls the enableLocalVideo(YES):

[stringeeCallA enableLocalVideo:YES];

3. Client A implements the StringeeCallMediaDelegate protocol to display the local and remote video (see Get started).

4. Client A sends an upgrade request to client B:

NSDictionary *callInfo = @{
                            @"requestVideo" : @(YES)
                          };
[stringeeCallA sendCallInfo:callInfo];

5. Client B implements the StringeeCallMediaDelegate protocol and overrides the didReceiveCallInfo:(StringeeCall )stringeeCall info:(NSDictionary )info method:

- (void)didReceiveCallInfo:(StringeeCall *)stringeeCall info:(NSDictionary *)info {
}

6. Client B calls the enableLocalVideo(YES):

- (void)didReceiveCallInfo:(StringeeCall *)stringeeCall info:(NSDictionary *)info {
    BOOL requestVideo = [[info objectForKey:@"requestVideo"] boolValue];
    if (requestVideo) {
        [stringeeCallB enableLocalVideo:YES];
    }
}

7. Client B displays the local and remote video (see Get started).