workadventure/front/src/Components/Video/LocalStreamMediaBox.svelte

16 lines
584 B
Svelte
Raw Normal View History

<script lang="typescript">
2021-12-06 16:12:37 +01:00
import type { ScreenSharingLocalMedia } from "../../Stores/ScreenSharingStore";
import { videoFocusStore } from "../../Stores/VideoFocusStore";
import { srcObject } from "./utils";
2021-12-06 16:12:37 +01:00
export let peer: ScreenSharingLocalMedia;
let stream = peer.stream;
2021-12-06 16:12:37 +01:00
export let cssClass: string | undefined;
</script>
<div class="video-container {cssClass ? cssClass : ''}" class:hide={!stream}>
{#if stream}
2021-12-06 16:12:37 +01:00
<video use:srcObject={stream} autoplay muted playsinline on:click={() => videoFocusStore.toggleFocus(peer)} />
{/if}
</div>