Skip to content

Commit

Permalink
feat: implement peer component using video and showing peer name
Browse files Browse the repository at this point in the history
  • Loading branch information
triptu committed Oct 7, 2022
1 parent 43b4e7c commit a378131
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 4 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,5 @@ Adapting [React Quickstart](https://www.100ms.live/docs/javascript/v2/guides/rea
9. Implement page.svelte, also add a leave on unload function for handling tab closing. Implement header with a logo and a leave button.
10. Implement JoinForm, takes in name and token and calls join function
11. Implement Conference, create a stub Peer.Svelte. Peer.svelte will use the Video.svelte file to render video and additionally show more details related to the peer.
12.
12. Implement Peer Component using Video and showing the peer name
13.
22 changes: 19 additions & 3 deletions src/routes/Peer.svelte
Original file line number Diff line number Diff line change
@@ -1,7 +1,23 @@
<script>
import Video from "./Video.svelte";
export let peer;
</script>

<p>
Peer - {peer.name}
</p>
<div class="peer-container">
<Video isLocal={peer.isLocal} videoTrackId={peer.videoTrack} />
<div class="peer-name">
{peer.name} {peer.isLocal ? "(You)" : ""}
</div>
</div>

<style>
.peer-name {
font-size: 14px;
text-align: center;
}
.peer-container {
padding: 10px;
}
</style>
6 changes: 6 additions & 0 deletions src/routes/Video.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<script>
export let isLocal;
export let videoTrackId;
</script>

<p>Video - {videoTrackId} - {isLocal}</p>

0 comments on commit a378131

Please sign in to comment.