diff --git a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/call/WebRTC.kt b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/call/WebRTC.kt index f723306456..89883e1bf8 100644 --- a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/call/WebRTC.kt +++ b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/call/WebRTC.kt @@ -17,7 +17,7 @@ data class Call( val callUUID: String?, val callState: CallState, val initialCallType: CallMediaType, - val localMediaSources: CallMediaSources = CallMediaSources(mic = true, camera = initialCallType == CallMediaType.Video && appPlatform.isAndroid), + val localMediaSources: CallMediaSources = CallMediaSources(mic = true, camera = initialCallType == CallMediaType.Video), val localCapabilities: CallCapabilities? = null, val peerMediaSources: CallMediaSources = CallMediaSources(), val sharedKey: String? = null, diff --git a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/chat/ChatView.kt b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/chat/ChatView.kt index 1cc81a351f..6ffd02dc60 100644 --- a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/chat/ChatView.kt +++ b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/chat/ChatView.kt @@ -779,30 +779,16 @@ fun ChatInfoToolbar( if (chatInfo is ChatInfo.Direct && chatInfo.contact.mergedPreferences.calls.enabled.forUser) { if (activeCall == null) { barButtons.add { - if (appPlatform.isAndroid) { - IconButton({ - showMenu.value = false - startCall(CallMediaType.Audio) - }, enabled = chatInfo.contact.ready && chatInfo.contact.active - ) { - Icon( - painterResource(MR.images.ic_call_500), - stringResource(MR.strings.icon_descr_audio_call).capitalize(Locale.current), - tint = if (chatInfo.contact.ready && chatInfo.contact.active) MaterialTheme.colors.primary else MaterialTheme.colors.secondary - ) - } - } else { - IconButton({ - showMenu.value = false - startCall(CallMediaType.Video) - }, enabled = chatInfo.contact.ready && chatInfo.contact.active - ) { - Icon( - painterResource(MR.images.ic_videocam), - stringResource(MR.strings.icon_descr_video_call).capitalize(Locale.current), - tint = if (chatInfo.contact.ready && chatInfo.contact.active) MaterialTheme.colors.primary else MaterialTheme.colors.secondary - ) - } + IconButton({ + showMenu.value = false + startCall(CallMediaType.Audio) + }, enabled = chatInfo.contact.ready && chatInfo.contact.active + ) { + Icon( + painterResource(MR.images.ic_call_500), + stringResource(MR.strings.icon_descr_audio_call).capitalize(Locale.current), + tint = if (chatInfo.contact.ready && chatInfo.contact.active) MaterialTheme.colors.primary else MaterialTheme.colors.secondary + ) } } } else if (activeCall?.contact?.id == chatInfo.id && appPlatform.isDesktop) { @@ -836,17 +822,10 @@ fun ChatInfoToolbar( } if (chatInfo.contact.ready && chatInfo.contact.active && activeCall == null) { menuItems.add { - if (appPlatform.isAndroid) { - ItemAction(stringResource(MR.strings.icon_descr_video_call).capitalize(Locale.current), painterResource(MR.images.ic_videocam), onClick = { - showMenu.value = false - startCall(CallMediaType.Video) - }) - } else { - ItemAction(stringResource(MR.strings.icon_descr_audio_call).capitalize(Locale.current), painterResource(MR.images.ic_call_500), onClick = { - showMenu.value = false - startCall(CallMediaType.Audio) - }) - } + ItemAction(stringResource(MR.strings.icon_descr_video_call).capitalize(Locale.current), painterResource(MR.images.ic_videocam), onClick = { + showMenu.value = false + startCall(CallMediaType.Video) + }) } } } else if (chatInfo is ChatInfo.Group && chatInfo.groupInfo.canAddMembers) { diff --git a/apps/multiplatform/common/src/commonMain/resources/assets/www/call.js b/apps/multiplatform/common/src/commonMain/resources/assets/www/call.js index 665bd14a74..f042859270 100644 --- a/apps/multiplatform/common/src/commonMain/resources/assets/www/call.js +++ b/apps/multiplatform/common/src/commonMain/resources/assets/www/call.js @@ -296,7 +296,7 @@ const processCommand = (function () { endCall(); let localStream = null; try { - localStream = await getLocalMediaStream(true, command.media == CallMediaType.Video && !isDesktop, VideoCamera.User); + localStream = await getLocalMediaStream(true, command.media == CallMediaType.Video, VideoCamera.User); const videos = getVideoElements(); if (videos) { videos.local.srcObject = localStream; @@ -325,7 +325,7 @@ const processCommand = (function () { if (activeCall) endCall(); inactiveCallMediaSources.mic = true; - inactiveCallMediaSources.camera = command.media == CallMediaType.Video && !isDesktop; + inactiveCallMediaSources.camera = command.media == CallMediaType.Video; inactiveCallMediaSourcesChanged(inactiveCallMediaSources); const { media, iceServers, relay } = command; const encryption = supportsInsertableStreams(useWorker); diff --git a/packages/simplex-chat-webrtc/src/call.ts b/packages/simplex-chat-webrtc/src/call.ts index 1a83c159c1..f27c87b870 100644 --- a/packages/simplex-chat-webrtc/src/call.ts +++ b/packages/simplex-chat-webrtc/src/call.ts @@ -560,7 +560,7 @@ const processCommand = (function () { let localStream: MediaStream | null = null try { - localStream = await getLocalMediaStream(true, command.media == CallMediaType.Video && !isDesktop, VideoCamera.User) + localStream = await getLocalMediaStream(true, command.media == CallMediaType.Video, VideoCamera.User) const videos = getVideoElements() if (videos) { videos.local.srcObject = localStream @@ -588,7 +588,7 @@ const processCommand = (function () { if (activeCall) endCall() inactiveCallMediaSources.mic = true - inactiveCallMediaSources.camera = command.media == CallMediaType.Video && !isDesktop + inactiveCallMediaSources.camera = command.media == CallMediaType.Video inactiveCallMediaSourcesChanged(inactiveCallMediaSources) const {media, iceServers, relay} = command