mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-17 11:08:06 +00:00
Disable video feature in config RC
This commit is contained in:
parent
75f841acc1
commit
9eb2e5609e
11 changed files with 33 additions and 10 deletions
|
|
@ -673,6 +673,12 @@ void update_hash_cbs(LinphoneAccountCreator *creator, LinphoneAccountCreatorStat
|
|||
if ([LinphoneManager.instance lpConfigBoolForKey:@"disable_chat_feature"]){
|
||||
[hiddenKeys addObject:@"message_menu"];
|
||||
}
|
||||
|
||||
if ([LinphoneManager.instance lpConfigBoolForKey:@"disable_video_feature"]) {
|
||||
[hiddenKeys addObject:@"enable_video_preference"];
|
||||
[hiddenKeys addObject:@"video_menu"];
|
||||
}
|
||||
|
||||
#ifndef DEBUG
|
||||
[hiddenKeys addObject:@"debug_actions_group"];
|
||||
[hiddenKeys addObject:@"release_button"];
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ class ConferenceWaitingRoomViewModel: ControlsViewModel {
|
|||
isMuteMicrophoneEnabled.value = true
|
||||
isSpeakerSelected.value = true
|
||||
isVideoEnabled.value = false
|
||||
isVideoAvailable.value = core.videoCaptureEnabled
|
||||
isVideoAvailable.value = core.videoCaptureEnabled && Core.get().config?.getBool(section: "app", key: "disable_video_feature", defaultValue: false) == false
|
||||
showLayoutPicker.value = false
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -146,6 +146,9 @@ import linphonesw
|
|||
//self.localVideo.isHidden = joining == true (UX question as video window goes black by the core, better black or hidden ?)
|
||||
self.noVideoLabel.isHidden = joining == true
|
||||
self.layoutPicker?.isHidden = joining == true
|
||||
if (Core.get().config?.getBool(section: "app", key: "disable_video_feature", defaultValue: false) == true) {
|
||||
self.layoutPicker!.isHidden = true
|
||||
}
|
||||
if (joining == true) {
|
||||
self.view.addSubview(self.conferenceJoinSpinner)
|
||||
self.conferenceJoinSpinner.square(AbstractIncomingOutgoingCallView.spinner_size).center().done()
|
||||
|
|
|
|||
|
|
@ -28,8 +28,8 @@ extension Call {
|
|||
}
|
||||
if (accept) {
|
||||
params.videoEnabled = true
|
||||
core?.videoCaptureEnabled = true
|
||||
core?.videoDisplayEnabled = true
|
||||
core?.videoCaptureEnabled = true && Core.get().config?.getBool(section: "app", key: "disable_video_feature", defaultValue: false) == false
|
||||
core?.videoDisplayEnabled = true && Core.get().config?.getBool(section: "app", key: "disable_video_feature", defaultValue: false) == false
|
||||
} else {
|
||||
params.videoEnabled = false
|
||||
}
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ class CallsViewModel {
|
|||
let localVideo = call.currentParams?.videoEnabled == true
|
||||
let autoAccept = call.core?.videoActivationPolicy?.automaticallyAccept == true
|
||||
if (remoteVideo && !localVideo && !autoAccept) {
|
||||
if (core.videoCaptureEnabled || core.videoDisplayEnabled) {
|
||||
if (core.videoCaptureEnabled || core.videoDisplayEnabled) && Core.get().config?.getBool(section: "app", key: "disable_video_feature", defaultValue: false) == false {
|
||||
try?call.deferUpdate()
|
||||
self.callUpdateEvent.value = call
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -267,7 +267,7 @@ class ConferenceViewModel {
|
|||
|
||||
private func updateConferenceLayout(conference: Conference) {
|
||||
if let call = conference.call, let params = call.params {
|
||||
conferenceDisplayMode.value = !params.videoEnabled ? ConferenceDisplayMode.AudioOnly : params.conferenceVideoLayout == .Grid ? .Grid : .ActiveSpeaker
|
||||
conferenceDisplayMode.value = !params.videoEnabled || Core.get().config?.getBool(section: "app", key: "disable_video_feature", defaultValue: false) == true ? ConferenceDisplayMode.AudioOnly : params.conferenceVideoLayout == .Grid ? .Grid : .ActiveSpeaker
|
||||
let list = sortDevicesDataList(devices: conferenceParticipantDevices.value!)
|
||||
conferenceParticipantDevices.value = list
|
||||
Log.i("[Conference] Conference current layout is: \(conferenceDisplayMode.value)")
|
||||
|
|
|
|||
|
|
@ -201,10 +201,10 @@ class ControlsViewModel {
|
|||
private func updateVideoAvailable() {
|
||||
let currentCall = core.currentCall
|
||||
isVideoAvailable.value =
|
||||
(core.videoCaptureEnabled || core.videoPreviewEnabled) &&
|
||||
((core.videoCaptureEnabled || core.videoPreviewEnabled) &&
|
||||
currentCall?.state != .Paused &&
|
||||
currentCall?.state != .PausedByRemote &&
|
||||
((currentCall != nil && currentCall?.mediaInProgress() != true) || (core.conference?.isIn == true))
|
||||
((currentCall != nil && currentCall?.mediaInProgress() != true) || (core.conference?.isIn == true))) && Core.get().config?.getBool(section: "app", key: "disable_video_feature", defaultValue: false) == false
|
||||
}
|
||||
|
||||
private func updateVideoEnabled() {
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@ import linphonesw
|
|||
self.videoAcceptDialog?.removeFromSuperview()
|
||||
self.videoAcceptDialog = nil
|
||||
} else if (call?.state == .UpdatedByRemote) {
|
||||
if (core.videoCaptureEnabled || core.videoDisplayEnabled) {
|
||||
if ((core.videoCaptureEnabled || core.videoDisplayEnabled) && Core.get().config?.getBool(section: "app", key: "disable_video_feature", defaultValue: false) == false) {
|
||||
if (call?.currentParams?.videoEnabled != call?.remoteParams?.videoEnabled) {
|
||||
let accept = ButtonAttributes(text:VoipTexts.dialog_accept, action: {call?.answerVideoUpdateRequest(accept: true)}, isDestructive:false)
|
||||
let cancel = ButtonAttributes(text:VoipTexts.dialog_decline, action: {call?.answerVideoUpdateRequest(accept: false)}, isDestructive:true)
|
||||
|
|
@ -88,6 +88,9 @@ import linphonesw
|
|||
self.videoAcceptDialog?.show()
|
||||
}
|
||||
} else {
|
||||
if (Core.get().config?.getBool(section: "app", key: "disable_video_feature", defaultValue: false) == true) {
|
||||
call?.answerVideoUpdateRequest(accept: false)
|
||||
}
|
||||
Log.w("[Call] Video display & capture are disabled, don't show video dialog")
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@
|
|||
|
||||
import Foundation
|
||||
import UIKit
|
||||
import linphonesw
|
||||
|
||||
class ControlsView: UIStackView {
|
||||
|
||||
|
|
@ -73,7 +74,7 @@ class ControlsView: UIStackView {
|
|||
}
|
||||
|
||||
// Video
|
||||
if (showVideo) {
|
||||
if (showVideo && Core.get().config?.getBool(section: "app", key: "disable_video_feature", defaultValue: false) == false) {
|
||||
let video = CallControlButton(buttonTheme: VoipTheme.call_video, onClickAction: {
|
||||
if AVCaptureDevice.authorizationStatus(for: .video) == .authorized {
|
||||
controlsViewModel.toggleVideo()
|
||||
|
|
|
|||
|
|
@ -115,7 +115,16 @@ class VoipExtraButtonsView: UIStackView {
|
|||
ControlsViewModel.shared.goToConferenceLayoutSettings.notifyAllObservers(with: true)
|
||||
})
|
||||
row2.addArrangedSubview(layoutselect)
|
||||
|
||||
|
||||
if (Core.get().config?.getBool(section: "app", key: "disable_video_feature", defaultValue: false) == true) {
|
||||
layoutselect.isEnabled = false
|
||||
layoutselect.setTitleColor(.gray, for: .disabled)
|
||||
if #available(iOS 13.0, *) {
|
||||
layoutselect.setImage(UIImage(named: "voip_conference_mosaic")!.withTintColor(.gray), for: .disabled)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
let calls = VoipExtraButton(text: VoipTexts.call_action_calls_list, buttonTheme: VoipTheme.call_action("voip_calls_list"), withbBoucinCounterDataSource: CallsViewModel.shared.inactiveCallsCount, onClickAction: {
|
||||
ControlsViewModel.shared.goToCallsListEvent.notifyAllObservers(with: true)
|
||||
})
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ use_callkit=1
|
|||
unexpected_pushkit=0
|
||||
force_lime_chat_rooms=0
|
||||
disable_chat_feature=0
|
||||
disable_video_feature=0
|
||||
|
||||
[in_app_purchase]
|
||||
#set to 1 if in-app purchases are to be shown in the application
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue