diff --git a/src/lib/components/calling/CallScreen.svelte b/src/lib/components/calling/CallScreen.svelte index 4c025e88f..7f98cfe69 100644 --- a/src/lib/components/calling/CallScreen.svelte +++ b/src/lib/components/calling/CallScreen.svelte @@ -24,12 +24,19 @@ export let deafened: boolean = get(Store.state.devices.deafened) export let chat: Chat + $: highlightUser = writable(undefined) + let showVolumeMixer = false let showCallSettings = false let muted: boolean = !VoiceRTCInstance.callOptions.audio.enabled let cameraEnabled: boolean = get(Store.state.devices.cameraEnabled) let isFullScreen = false - let localVideoCurrentSrc: HTMLVideoElement + $: localVideoCurrentSrc = writable(undefined) + $: { + if ($localVideoCurrentSrc) { + VoiceRTCInstance.setVideoElements($localVideoCurrentSrc) + } + } let showAnimation = true let message = $_("settings.calling.connecting") @@ -184,7 +191,6 @@ callTimeout.set(false) usersAcceptedTheCall.set([]) document.addEventListener("mousedown", handleClickOutside) - await VoiceRTCInstance.setVideoElements(localVideoCurrentSrc) /// HACK: To make sure the video elements are loaded before we start the call if (VoiceRTCInstance.localVideoCurrentSrc && VoiceRTCInstance.remoteVideoCreator) { if (VoiceRTCInstance.toCall && VoiceRTCInstance.toCall.find(did => did !== "") !== undefined && $callInProgress === null) { @@ -262,7 +268,10 @@ return bVideoEnabled - aVideoEnabled }) users = [self, ...users] - usersSplit = chat.users.reduce((res, item, index) => { + if ($highlightUser) { + users = users.filter(user => user !== $highlightUser) + } + usersSplit = users.reduce((res, item, index) => { const chunk = Math.floor(index / vidPerRow) if (!res[chunk]) { res[chunk] = [] @@ -272,6 +281,15 @@ }, []) }, 100)() } + + function setHighlightUser(user: string) { + if (user === $highlightUser) { + $highlightUser = undefined + } else { + $highlightUser = user + } + updateUserListSplit() + }
@@ -315,12 +333,65 @@ {#if !$callTimeout && ($usersDeniedTheCall.length === 0 || $usersDeniedTheCall.length !== chat.users.length - 1)}
+ {#if $highlightUser && ($highlightUser === get(Store.state.user).key || $remoteStreams[$highlightUser])} + {@const user = $highlightUser} +
+ {#if user === get(Store.state.user).key} +
setHighlightUser(user)}> + +
{ownUserName}
+ {#if !userCallOptions.audio.enabled} +
+ +
+ {/if} +
+ {#if !userCallOptions.video.enabled} + setHighlightUser(user)} /> + {/if} + {:else if $remoteStreams[user]} +
setHighlightUser(user)}> + +
{$userCache[user].name}
+ {#if !$remoteStreams[user].user.audioEnabled} +
+ +
+ {/if} +
+ + {#if !$remoteStreams[user].stream || !$remoteStreams[user].user.videoEnabled} + setHighlightUser(user)} /> + {/if} + {/if} +
+ {/if} {#each usersSplit as users, i} -
+
{#each users as user} {#if user === get(Store.state.user).key} -
-