2021-05-28 09:31:04 +02:00
|
|
|
<script lang="typescript">
|
|
|
|
import {requestedScreenSharingState, screenSharingAvailableStore} from "../Stores/ScreenSharingStore";
|
|
|
|
import {requestedCameraState, requestedMicrophoneState} from "../Stores/MediaStore";
|
|
|
|
import monitorImg from "./images/monitor.svg";
|
|
|
|
import monitorCloseImg from "./images/monitor-close.svg";
|
|
|
|
import cinemaImg from "./images/cinema.svg";
|
|
|
|
import cinemaCloseImg from "./images/cinema-close.svg";
|
|
|
|
import microphoneImg from "./images/microphone.svg";
|
|
|
|
import microphoneCloseImg from "./images/microphone-close.svg";
|
|
|
|
|
|
|
|
function screenSharingClick(): void {
|
|
|
|
if ($requestedScreenSharingState === true) {
|
|
|
|
requestedScreenSharingState.disableScreenSharing();
|
|
|
|
} else {
|
|
|
|
requestedScreenSharingState.enableScreenSharing();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function cameraClick(): void {
|
|
|
|
if ($requestedCameraState === true) {
|
|
|
|
requestedCameraState.disableWebcam();
|
|
|
|
} else {
|
|
|
|
requestedCameraState.enableWebcam();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function microphoneClick(): void {
|
|
|
|
if ($requestedMicrophoneState === true) {
|
|
|
|
requestedMicrophoneState.disableMicrophone();
|
|
|
|
} else {
|
|
|
|
requestedMicrophoneState.enableMicrophone();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<div class="btn-cam-action">
|
2021-05-30 15:29:28 +02:00
|
|
|
<div class="btn-micro nes-btn is-dark" on:click={microphoneClick} class:disabled={!$requestedMicrophoneState}>
|
|
|
|
{#if $requestedMicrophoneState}
|
|
|
|
<img src={microphoneImg} alt="Turn on microphone">
|
2021-05-28 09:31:04 +02:00
|
|
|
{:else}
|
2021-05-30 15:29:28 +02:00
|
|
|
<img src={microphoneCloseImg} alt="Turn off microphone">
|
2021-05-28 09:31:04 +02:00
|
|
|
{/if}
|
|
|
|
</div>
|
2021-05-30 15:29:28 +02:00
|
|
|
<div class="btn-video nes-btn is-dark" on:click={cameraClick} class:disabled={!$requestedCameraState}>
|
2021-05-28 09:31:04 +02:00
|
|
|
{#if $requestedCameraState}
|
|
|
|
<img src={cinemaImg} alt="Turn on webcam">
|
|
|
|
{:else}
|
|
|
|
<img src={cinemaCloseImg} alt="Turn off webcam">
|
|
|
|
{/if}
|
|
|
|
</div>
|
2021-05-30 15:29:28 +02:00
|
|
|
<div class="btn-monitor nes-btn is-dark" on:click={screenSharingClick} class:hide={!$screenSharingAvailableStore} class:enabled={$requestedScreenSharingState}>
|
|
|
|
{#if $requestedScreenSharingState}
|
|
|
|
<img src={monitorImg} alt="Start screen sharing">
|
2021-05-28 09:31:04 +02:00
|
|
|
{:else}
|
2021-05-30 15:29:28 +02:00
|
|
|
<img src={monitorCloseImg} alt="Stop screen sharing">
|
2021-05-28 09:31:04 +02:00
|
|
|
{/if}
|
|
|
|
</div>
|
|
|
|
</div>
|