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

27 lines
843 B
Svelte
Raw Normal View History

2021-06-15 17:30:28 +02:00
<script lang="ts">
2021-12-06 16:12:37 +01:00
import { streamableCollectionStore } from "../../Stores/StreamableCollectionStore";
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-12-06 16:12:37 +01:00
});
2021-06-15 17:30:28 +02:00
</script>
<div class="main-section">
2021-12-06 16:12:37 +01:00
{#if $videoFocusStore}
{#key $videoFocusStore.uniqueId}
2021-12-06 16:12:37 +01:00
<MediaBox streamable={$videoFocusStore} />
{/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-12-06 16:12:37 +01:00
{#if peer !== $videoFocusStore}
<MediaBox streamable={peer} />
2021-06-15 17:30:28 +02:00
{/if}
{/each}
</aside>