Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: implement footer with audio video toggle buttons
- Loading branch information
Showing
4 changed files
with
77 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,7 +24,7 @@ | |
<Header/> | ||
{#if $hmsIsConnected} | ||
<Conference /> | ||
<Footer/> | ||
{:else} | ||
<JoinForm /> | ||
{/if} | ||
<Footer/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
<script lang="ts"> | ||
import { hmsActions } from './hms'; | ||
import {hmsIsAudioEnabled, hmsIsVideoEnabled} from "./hmsStores"; | ||
function toggleAudio() { | ||
hmsActions.setLocalAudioEnabled(!$hmsIsAudioEnabled); | ||
} | ||
function toggleVideo() { | ||
hmsActions.setLocalVideoEnabled(!$hmsIsVideoEnabled); | ||
} | ||
</script> | ||
|
||
<footer class="control-bar"> | ||
<button class="btn-control" on:click={toggleAudio}> | ||
{#if $hmsIsAudioEnabled} | ||
Mute | ||
{:else} | ||
Unmute | ||
{/if} | ||
</button> | ||
|
||
<button class="btn-control" on:click={toggleVideo}> | ||
{#if $hmsIsVideoEnabled} | ||
Stop Video | ||
{:else} | ||
Show video | ||
{/if} | ||
</button> | ||
</footer> | ||
|
||
<style> | ||
.control-bar { | ||
position: fixed; | ||
bottom: 0; | ||
width: 100%; | ||
z-index: 10; | ||
display: flex; | ||
justify-content: center; | ||
padding: 15px; | ||
} | ||
.control-bar > *:not(:first-child) { | ||
margin-left: 8px; | ||
} | ||
.btn-control { | ||
width: 64px; | ||
height: 64px; | ||
background-color: #607d8b; | ||
font-size: 12px; | ||
text-transform: uppercase; | ||
letter-spacing: 1px; | ||
text-align: center; | ||
color: white; | ||
border: 2px solid #37474f; | ||
border-radius: 50%; | ||
box-shadow: 0 0 10px rgba(0, 0, 0, 0.4); | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
64f8c65
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
svelte-quickstart – ./
svelte-quickstart.vercel.app
svelte-quickstart-100mslive.vercel.app
svelte-quickstart-git-main-100mslive.vercel.app