Fixed issue with call video update dialog
This commit is contained in:
parent
62083bc5c0
commit
3dffd6b39c
4 changed files with 12 additions and 8 deletions
|
@ -93,7 +93,9 @@ class ControlsFragment : GenericFragment<CallControlsFragmentBinding>() {
|
||||||
if (call.state == Call.State.StreamsRunning) {
|
if (call.state == Call.State.StreamsRunning) {
|
||||||
dialog?.dismiss()
|
dialog?.dismiss()
|
||||||
} else if (call.state == Call.State.UpdatedByRemote) {
|
} else if (call.state == Call.State.UpdatedByRemote) {
|
||||||
showCallUpdateDialog(call)
|
if (call.currentParams.videoEnabled() != call.remoteParams?.videoEnabled()) {
|
||||||
|
showCallVideoUpdateDialog(call)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -219,17 +221,17 @@ class ControlsFragment : GenericFragment<CallControlsFragmentBinding>() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun showCallUpdateDialog(call: Call) {
|
private fun showCallVideoUpdateDialog(call: Call) {
|
||||||
val viewModel = DialogViewModel(AppUtils.getString(R.string.call_video_update_requested_dialog))
|
val viewModel = DialogViewModel(AppUtils.getString(R.string.call_video_update_requested_dialog))
|
||||||
dialog = DialogUtils.getDialog(requireContext(), viewModel)
|
dialog = DialogUtils.getDialog(requireContext(), viewModel)
|
||||||
|
|
||||||
viewModel.showCancelButton({
|
viewModel.showCancelButton({
|
||||||
callsViewModel.answerCallUpdateRequest(call, false)
|
callsViewModel.answerCallVideoUpdateRequest(call, false)
|
||||||
dialog?.dismiss()
|
dialog?.dismiss()
|
||||||
}, getString(R.string.dialog_decline))
|
}, getString(R.string.dialog_decline))
|
||||||
|
|
||||||
viewModel.showOkButton({
|
viewModel.showOkButton({
|
||||||
callsViewModel.answerCallUpdateRequest(call, true)
|
callsViewModel.answerCallVideoUpdateRequest(call, true)
|
||||||
dialog?.dismiss()
|
dialog?.dismiss()
|
||||||
}, getString(R.string.dialog_accept))
|
}, getString(R.string.dialog_accept))
|
||||||
|
|
||||||
|
|
|
@ -129,7 +129,7 @@ open class CallViewModel(val call: Call) : GenericContactViewModel(call.remoteAd
|
||||||
// Decline call update
|
// Decline call update
|
||||||
viewModelScope.launch {
|
viewModelScope.launch {
|
||||||
withContext(Dispatchers.Main) {
|
withContext(Dispatchers.Main) {
|
||||||
coreContext.answerCallUpdateRequest(call, false)
|
coreContext.answerCallVideoUpdateRequest(call, false)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -128,8 +128,8 @@ class CallsViewModel : ViewModel() {
|
||||||
super.onCleared()
|
super.onCleared()
|
||||||
}
|
}
|
||||||
|
|
||||||
fun answerCallUpdateRequest(call: Call, accept: Boolean) {
|
fun answerCallVideoUpdateRequest(call: Call, accept: Boolean) {
|
||||||
coreContext.answerCallUpdateRequest(call, accept)
|
coreContext.answerCallVideoUpdateRequest(call, accept)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun pauseConference() {
|
fun pauseConference() {
|
||||||
|
|
|
@ -313,13 +313,15 @@ class CoreContext(val context: Context, coreConfig: Config) {
|
||||||
|
|
||||||
/* Call related functions */
|
/* Call related functions */
|
||||||
|
|
||||||
fun answerCallUpdateRequest(call: Call, accept: Boolean) {
|
fun answerCallVideoUpdateRequest(call: Call, accept: Boolean) {
|
||||||
val params = core.createCallParams(call)
|
val params = core.createCallParams(call)
|
||||||
|
|
||||||
if (accept) {
|
if (accept) {
|
||||||
params?.enableVideo(true)
|
params?.enableVideo(true)
|
||||||
core.enableVideoCapture(true)
|
core.enableVideoCapture(true)
|
||||||
core.enableVideoDisplay(true)
|
core.enableVideoDisplay(true)
|
||||||
|
} else {
|
||||||
|
params?.enableVideo(false)
|
||||||
}
|
}
|
||||||
|
|
||||||
call.acceptUpdate(params)
|
call.acceptUpdate(params)
|
||||||
|
|
Loading…
Reference in a new issue