From c5612ad07497651278decaa48a2819280dd4def3 Mon Sep 17 00:00:00 2001 From: lgmarchi Date: Thu, 14 Nov 2024 13:28:04 -0300 Subject: [PATCH 01/11] feat(calling): enhance video preview functionality and improve stream handling --- .../components/calling/VideoPreview.svelte | 111 +++++++++++------- src/lib/media/Voice.ts | 2 +- src/routes/+layout.svelte | 2 +- 3 files changed, 72 insertions(+), 43 deletions(-) diff --git a/src/lib/components/calling/VideoPreview.svelte b/src/lib/components/calling/VideoPreview.svelte index 00af59c5c..353dc5fe3 100644 --- a/src/lib/components/calling/VideoPreview.svelte +++ b/src/lib/components/calling/VideoPreview.svelte @@ -1,54 +1,71 @@ -
+
- - {#if !otherUserSettingsInCall?.videoEnabled && chat !== undefined} + {#if chat !== undefined && get(Store.state.activeCall) !== null && $callScreenVisible === false} {#each chat.users as user} - {#if user !== ownUser.key} - + {#if $userCache[user] && $userCache[user].key !== ownUser.key && $remoteStreams[user]} +
+ +
{$userCache[user].name}
+ {#if !$remoteStreams[user].user.audioEnabled} +
+ +
+ {/if} +
+ + {#if !$remoteStreams[user].stream || !$remoteStreams[user].user.videoEnabled} + {}} /> + {/if} {/if} {/each} {/if} diff --git a/src/lib/media/Voice.ts b/src/lib/media/Voice.ts index 4cc78d183..5b027fd32 100644 --- a/src/lib/media/Voice.ts +++ b/src/lib/media/Voice.ts @@ -734,7 +734,6 @@ export class VoiceRTC { } async leaveCall(sendEndCallMessage = false) { - callScreenVisible.set(false) callInProgress.set(null) timeCallStarted.set(null) usersDeniedTheCall.set([]) @@ -759,6 +758,7 @@ export class VoiceRTC { if (get(Store.state.activeCall)) { Store.endCall() } + callScreenVisible.set(false) if (get(Store.state.pendingCall)) { Store.denyCall() diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte index 652eb5af8..327a34af6 100644 --- a/src/routes/+layout.svelte +++ b/src/routes/+layout.svelte @@ -290,7 +290,7 @@ - + UIStore.toggleMarket()} /> From a8090e80acce431a2ff47b4f9146ce1cfa17181c Mon Sep 17 00:00:00 2001 From: lgmarchi Date: Thu, 14 Nov 2024 14:13:02 -0300 Subject: [PATCH 02/11] feat(calling): enhance video preview layout and add user name and mute status indicators --- .../components/calling/VideoPreview.svelte | 65 ++++++++++++++++++- 1 file changed, 63 insertions(+), 2 deletions(-) diff --git a/src/lib/components/calling/VideoPreview.svelte b/src/lib/components/calling/VideoPreview.svelte index 353dc5fe3..7aeef52fe 100644 --- a/src/lib/components/calling/VideoPreview.svelte +++ b/src/lib/components/calling/VideoPreview.svelte @@ -1,4 +1,5 @@ -
+
diff --git a/src/lib/media/Voice.ts b/src/lib/media/Voice.ts index 8173b606a..0a1bd7c64 100644 --- a/src/lib/media/Voice.ts +++ b/src/lib/media/Voice.ts @@ -29,6 +29,7 @@ export const callInProgress: Writable = writable(null) export const makeCallSound = writable(undefined) export const callScreenVisible = writable(false) export const usersDidInActiveCall = writable([]) +export const showCallPopUp = writable(false) const relaysToTest = [ "wss://nostr-pub.wellorder.net", @@ -815,6 +816,7 @@ export class VoiceRTC { async leaveCall(sendEndCallMessage = false) { callInProgress.set(null) timeCallStarted.set(null) + showCallPopUp.set(false) usersDeniedTheCall.set([]) callTimeout.set(false) connectionOpened.set(false) From f4be1613aaf873f3d3bd1a33bc9b04c19281321e Mon Sep 17 00:00:00 2001 From: lgmarchi Date: Fri, 22 Nov 2024 08:26:12 -0300 Subject: [PATCH 10/11] fix(video-preview): update video container display logic for screen sharing and video enabled states --- src/lib/components/calling/VideoPreview.svelte | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/lib/components/calling/VideoPreview.svelte b/src/lib/components/calling/VideoPreview.svelte index 20b0a5214..b52fc7309 100644 --- a/src/lib/components/calling/VideoPreview.svelte +++ b/src/lib/components/calling/VideoPreview.svelte @@ -154,8 +154,17 @@
{#each filteredUsers.slice(0, 3) as user} {#if $remoteStreams[user]} -
-