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

27 lines
854 B
Svelte
Raw Normal View History

2021-06-15 17:30:28 +02:00
<script lang="ts">
2021-06-21 14:43:10 +02:00
import {streamableCollectionStore} from "../../Stores/StreamableCollectionStore";
2021-06-15 17:30:28 +02:00
import {videoFocusStore} from "../../Stores/VideoFocusStore";
import {afterUpdate} from "svelte";
import {biggestAvailableAreaStore} from "../../Stores/BiggestAvailableAreaStore";
2021-06-21 14:43:10 +02:00
import MediaBox from "./MediaBox.svelte";
afterUpdate(() => {
biggestAvailableAreaStore.recompute();
})
2021-06-15 17:30:28 +02:00
</script>
<div class="main-section">
2021-06-21 14:43:10 +02:00
{#if $videoFocusStore }
{#key $videoFocusStore.uniqueId}
<MediaBox streamable={$videoFocusStore}></MediaBox>
{/key}
2021-06-21 14:43:10 +02:00
{/if}
2021-06-15 17:30:28 +02:00
</div>
<aside class="sidebar">
2021-06-21 14:43:10 +02:00
{#each [...$streamableCollectionStore.values()] as peer (peer.uniqueId)}
2021-06-15 17:30:28 +02:00
{#if peer !== $videoFocusStore }
2021-06-21 14:43:10 +02:00
<MediaBox streamable={peer}></MediaBox>
2021-06-15 17:30:28 +02:00
{/if}
{/each}
</aside>