diff --git a/src/components/TopBar/CallButton.vue b/src/components/TopBar/CallButton.vue index 3d5dc721b3e..c0a2db3a8eb 100644 --- a/src/components/TopBar/CallButton.vue +++ b/src/components/TopBar/CallButton.vue @@ -13,8 +13,11 @@ import { useIsMobile } from '@nextcloud/vue/composables/useIsMobile' import { computed, ref, watch } from 'vue' import { useRouter } from 'vue-router' import { useStore } from 'vuex' +import NcActionButton from '@nextcloud/vue/components/NcActionButton' +import NcActions from '@nextcloud/vue/components/NcActions' import NcButton from '@nextcloud/vue/components/NcButton' import NcLoadingIcon from '@nextcloud/vue/components/NcLoadingIcon' +import IconChevronDown from 'vue-material-design-icons/ChevronDown.vue' import IconPhone from 'vue-material-design-icons/Phone.vue' // Filled used for non-silent calls import IconPhoneDialOutline from 'vue-material-design-icons/PhoneDialOutline.vue' import IconPhoneOutline from 'vue-material-design-icons/PhoneOutline.vue' @@ -95,6 +98,13 @@ const startCallButtonDisabled = computed(() => { || !tokenStore.currentConversationIsJoined || blockCalls }) +const showSplitStartCallButton = computed(() => { + return showStartCallButton.value + && !props.isMediaSettings + && !isPhoneRoom.value + && !hasExternalCallService(conversation.value) + && !hasCall.value +}) const showRecordingWarning = computed(() => { return [ CALL.RECORDING.VIDEO_STARTING, @@ -130,6 +140,9 @@ const startCallTitle = computed(() => { return '' }) +const startCallSilentlyLabel = t('spreed', 'Start call silently') +const startCallActionsLabel = t('spreed', 'More actions') + watch(token, (newValue, oldValue) => { callViewStore.resetCallHasJustEnded() talkHashStore.resetTalkProxyHashDirty(oldValue) @@ -137,11 +150,13 @@ watch(token, (newValue, oldValue) => { /** * Start or join the call + * + * @param silent - force a silent start, bypassing the `silentCall` prop */ -async function handleJoinCall() { +async function handleJoinCall(silent?: boolean) { loading.value = true await joinCall(token.value, { - silent: hasCall.value ? true : props.silentCall, + silent: hasCall.value ? true : (silent ?? props.silentCall), recordingConsent: props.recordingConsentGiven, shouldStartRecording: props.isRecordingFromStart, }) @@ -173,6 +188,16 @@ function handleClick() { } } +/** + * Skip the device checker (MediaSettings) and start the call right away + */ +function handleStartCallSilently() { + // Create audio objects as a result of a user interaction to allow playing sounds in Safari + soundsStore.initAudioObjects() + + handleJoinCall(true) +} + /** * Initiate a call at external service (iframe embedded) */ @@ -203,8 +228,40 @@ async function handleExternalCall() {