Save current audio and video state before switching to another call.

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

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

@ -41,6 +41,7 @@
@property (nonatomic, weak) id<CallViewControllerDelegate> delegate;
@property (nonatomic, strong) NCRoom *room;
@property (nonatomic, assign) BOOL audioDisabledAtStart;
@property (nonatomic, assign) BOOL videoDisabledAtStart;
@property (nonatomic, assign) BOOL voiceChatModeAtStart;
@property (nonatomic, assign) BOOL silentCall;

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

@ -170,6 +170,7 @@ typedef void (^UpdateCallParticipantViewCellBlock)(CallParticipantViewCell *cell
{
_callController = [[NCCallController alloc] initWithDelegate:self inRoom:_room forAudioOnlyCall:_isAudioOnly withSessionId:sessionId andVoiceChatMode:_voiceChatModeAtStart];
_callController.userDisplayName = _displayName;
_callController.disableAudioAtStart = _audioDisabledAtStart;
_callController.disableVideoAtStart = _videoDisabledAtStart;
_callController.silentCall = _silentCall;
@ -1777,6 +1778,9 @@ typedef void (^UpdateCallParticipantViewCellBlock)(CallParticipantViewCell *cell
[self.delegate callViewController:self wantsToSwitchCallFromCall:self->_room.token toRoom:token];
// 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;
// Forget current call controller
self->_callController = nil;
// Join new room