Get audio and video state before stopping call controller.

Signed-off-by: Ivan Sein <ivan@nextcloud.com>
This commit is contained in:
Ivan Sein 2023-02-01 16:35:15 +01:00
Родитель 20e5f7149e
Коммит cfb43ba6a8
3 изменённых файлов: 7 добавлений и 5 удалений

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

@ -1769,7 +1769,7 @@ typedef void (^UpdateCallParticipantViewCellBlock)(CallParticipantViewCell *cell
});
}
- (void)callController:(NCCallController *)callController isSwitchingToCall:(NSString *)token
- (void)callController:(NCCallController *)callController isSwitchingToCall:(NSString *)token withAudioEnabled:(BOOL)audioEnabled andVideoEnabled:(BOOL)videoEnabled
{
[self setCallState:CallStateSwitchingToAnotherRoom];
@ -1794,8 +1794,8 @@ typedef void (^UpdateCallParticipantViewCellBlock)(CallParticipantViewCell *cell
// Asign new room as current room
self->_room = [NCRoom roomWithDictionary:roomDict andAccountId:activeAccount.accountId];
// Save current audio and video state
self->_audioDisabledAtStart = !self->_callController.isAudioEnabled;
self->_videoDisabledAtStart = !self->_callController.isVideoEnabled;
self->_audioDisabledAtStart = !audioEnabled;
self->_videoDisabledAtStart = !videoEnabled;
// Forget current call controller
self->_callController = nil;
// Join new room

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

@ -52,7 +52,7 @@
- (void)callControllerIsReconnectingCall:(NCCallController *)callController;
- (void)callControllerWantsToHangUpCall:(NCCallController *)callController;
- (void)callControllerDidChangeRecording:(NCCallController *)callController;
- (void)callController:(NCCallController *)callController isSwitchingToCall:(NSString *)token;
- (void)callController:(NCCallController *)callController isSwitchingToCall:(NSString *)token withAudioEnabled:(BOOL)audioEnabled andVideoEnabled:(BOOL)videoEnabled;
@end

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

@ -262,9 +262,11 @@ static NSString * const kNCVideoTrackKind = @"video";
- (void)willSwitchToCall:(NSString *)token
{
NSLog(@"willSwitchToCall");
BOOL isAudioEnabled = [self isAudioEnabled];
BOOL isVideoEnabled = [self isVideoEnabled];
_userInCall = 0;
[self stopCallController];
[self.delegate callController:self isSwitchingToCall:token];
[self.delegate callController:self isSwitchingToCall:token withAudioEnabled:isAudioEnabled andVideoEnabled:isVideoEnabled];
}