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}