2021-06-11 11:29:36 +02:00
|
|
|
<script lang="typescript">
|
2021-06-14 17:59:50 +02:00
|
|
|
import {ScreenSharingLocalMedia} from "../../Stores/ScreenSharingStore";
|
2021-06-15 14:45:01 +02:00
|
|
|
import {videoFocusStore} from "../../Stores/VideoFocusStore";
|
2021-06-14 17:59:50 +02:00
|
|
|
|
2021-06-11 11:29:36 +02:00
|
|
|
function srcObject(node, stream) {
|
|
|
|
node.srcObject = stream;
|
|
|
|
return {
|
|
|
|
update(newStream) {
|
|
|
|
if (node.srcObject != newStream) {
|
|
|
|
node.srcObject = newStream
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-06-14 17:59:50 +02:00
|
|
|
export let peer : ScreenSharingLocalMedia;
|
|
|
|
let stream : MediaStream|undefined = peer.stream;
|
2021-06-11 11:29:36 +02:00
|
|
|
export let cssClass : string|undefined;
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
2021-06-15 14:45:01 +02:00
|
|
|
<div class="video-container {cssClass ? cssClass : ''}" class:hide={!stream}>
|
|
|
|
<video use:srcObject={stream} autoplay muted playsinline on:click={() => videoFocusStore.toggleFocus(peer)}></video>
|
2021-06-11 11:29:36 +02:00
|
|
|
</div>
|