Merge pull request #1798 from thecodingmachine/fix-my-cam

Fix bugs on new camera display
This commit is contained in:
Alexis Faizeau 2022-01-31 12:57:03 +01:00 committed by GitHub
commit 4210334aa2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 15 additions and 6 deletions

View file

@ -15,7 +15,7 @@
if (stream) { if (stream) {
embedScreen = { embedScreen = {
type: "streamable", type: "streamable",
embed: stream as unknown as Streamable, embed: peer as unknown as Streamable,
}; };
} }
</script> </script>

View file

@ -31,10 +31,10 @@
<div class="rtc-error" /> <div class="rtc-error" />
{/if} {/if}
{#if $streamStore !== null} {#if $streamStore !== null}
<!-- svelte-ignore a11y-media-has-caption -->
<i class="container"> <i class="container">
<span style="background-color: {getColorByString(name)};">{name}</span> <span style="background-color: {getColorByString(name)};">{name}</span>
</i> </i>
<!-- svelte-ignore a11y-media-has-caption -->
<video <video
use:srcObject={$streamStore} use:srcObject={$streamStore}
autoplay autoplay

View file

@ -50,7 +50,12 @@
}); });
</script> </script>
<div class="video-container" class:no-clikable={!clickable} bind:this={videoContainer}> <div
class="video-container"
class:no-clikable={!clickable}
bind:this={videoContainer}
on:click={() => (clickable ? highlightedEmbedScreen.toggleHighlight(embedScreen) : null)}
>
{#if $statusStore === "connecting"} {#if $statusStore === "connecting"}
<div class="connecting-spinner" /> <div class="connecting-spinner" />
{/if} {/if}

View file

@ -2,6 +2,7 @@ import { derived, get, Readable } from "svelte/store";
import { ScreenSharingLocalMedia, screenSharingLocalMedia } from "./ScreenSharingStore"; import { ScreenSharingLocalMedia, screenSharingLocalMedia } from "./ScreenSharingStore";
import { peerStore, screenSharingStreamStore } from "./PeerStore"; import { peerStore, screenSharingStreamStore } from "./PeerStore";
import type { RemotePeer } from "../WebRtc/SimplePeer"; import type { RemotePeer } from "../WebRtc/SimplePeer";
import { highlightedEmbedScreen } from "./EmbedScreensStore";
export type Streamable = RemotePeer | ScreenSharingLocalMedia; export type Streamable = RemotePeer | ScreenSharingLocalMedia;
@ -25,6 +26,12 @@ function createStreamableCollectionStore(): Readable<Map<string, Streamable>> {
addPeer($screenSharingLocalMedia); addPeer($screenSharingLocalMedia);
} }
const $highlightedEmbedScreen = get(highlightedEmbedScreen);
if ($highlightedEmbedScreen?.type === "streamable" && !peers.has($highlightedEmbedScreen.embed.uniqueId)) {
highlightedEmbedScreen.removeHighlight();
}
set(peers); set(peers);
} }
); );

View file

@ -38,8 +38,6 @@ body .message-info.warning{
.video-container { .video-container {
display: flex; display: flex;
transition: all 0.2s ease; transition: all 0.2s ease;
background-color: #00000099;
border-radius: 15px;
cursor: url('./images/cursor_pointer.png'), pointer; cursor: url('./images/cursor_pointer.png'), pointer;
width: 100%; width: 100%;
@ -55,7 +53,6 @@ body .message-info.warning{
max-width: 100%; max-width: 100%;
width: 100%; width: 100%;
cursor: url('./images/cursor_pointer.png'), pointer; cursor: url('./images/cursor_pointer.png'), pointer;
border-radius: 15px;
&.mobile{ &.mobile{
width: 100%; width: 100%;