From c0c28390039aae92b287a55d78c577ca5a83dd0e Mon Sep 17 00:00:00 2001 From: Gagan Suie Date: Wed, 15 May 2024 10:58:32 -0500 Subject: [PATCH] Fix: testing null video elements --- src/lib/WHIPClient.ts | 4 +++- src/lib/components/Channel/Stream/VideoItem.svelte | 3 +-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/lib/WHIPClient.ts b/src/lib/WHIPClient.ts index f7b147a3..4ffc4a6d 100644 --- a/src/lib/WHIPClient.ts +++ b/src/lib/WHIPClient.ts @@ -154,7 +154,9 @@ export default class WHIPClient extends EventTarget { // }) this.peerConnection.close() this.localStream?.getTracks().forEach((track) => track.stop()) - this.videoElement.srcObject = null + if (this.videoElement) { + this.videoElement.srcObject = null + } this.dispatchEvent(new CustomEvent(`localStreamStopped-${this.trackType}`)) console.log('Disconnected') } diff --git a/src/lib/components/Channel/Stream/VideoItem.svelte b/src/lib/components/Channel/Stream/VideoItem.svelte index 517d5b93..b662a254 100644 --- a/src/lib/components/Channel/Stream/VideoItem.svelte +++ b/src/lib/components/Channel/Stream/VideoItem.svelte @@ -436,8 +436,7 @@ class="rounded-md w-full h-full" allow="accelerometer; gyroscope; autoplay; encrypted-media; picture-in-picture; fullscreen;" /> - {/if} - {#if !iframeUrl} + {:else}