-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update useParticipiants to show all video tracks (#67)
## Description For random reason, `useParticipiants` only returned single audio/video track per peer. This change updates code so it returns all tracks. I also refactored videoroom example, to extract `App` into smaller components. ## Motivation and Context Fix bug, that prevented testing videoshare ## Types of changes - [ ] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- Loading branch information
1 parent
f793da8
commit 7c086c5
Showing
11 changed files
with
68 additions
and
55 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
File renamed without changes.
12 changes: 12 additions & 0 deletions
12
examples/react-client/videoroom/src/components/AudioTracks.tsx
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,12 @@ | ||
import AudioPlayer from "./AudioPlayer"; | ||
import { Track } from "@fishjam-cloud/react-client"; | ||
|
||
type Props = { | ||
audioTracks: Track<unknown>[] | undefined; | ||
}; | ||
|
||
export function AudioTracks({ audioTracks }: Props) { | ||
return audioTracks?.map((audioTrack) => ( | ||
<AudioPlayer stream={audioTrack.stream} key={audioTrack.trackId} /> | ||
)); | ||
} |
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...act-client/videoroom/src/DevicePicker.tsx → ...videoroom/src/components/DevicePicker.tsx
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
2 changes: 1 addition & 1 deletion
2
...ct-client/videoroom/src/RoomConnector.tsx → ...ideoroom/src/components/RoomConnector.tsx
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
File renamed without changes.
30 changes: 30 additions & 0 deletions
30
examples/react-client/videoroom/src/components/VideoTracks.tsx
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,30 @@ | ||
import VideoPlayer from "./VideoPlayer"; | ||
import { Track } from "@fishjam-cloud/react-client"; | ||
|
||
type Props = { | ||
id: string; | ||
name: string; | ||
videoTracks: Track<unknown>[]; | ||
}; | ||
|
||
export function VideoTracks({ videoTracks, name, id }: Props) { | ||
return videoTracks.map((videoTrack) => ( | ||
<div | ||
className="aspect-video overflow-hidden grid place-content-center relative bg-zinc-300 rounded-md" | ||
key={videoTrack.trackId} | ||
> | ||
{videoTrack && ( | ||
<VideoPlayer | ||
className="rounded-md z-20" | ||
key={videoTrack.trackId} | ||
stream={videoTrack.stream} | ||
peerId={id} | ||
/> | ||
)} | ||
|
||
<div className="absolute bottom-2 left-0 w-full grid place-content-center text-center text-xs z-30"> | ||
<p className="bg-slate-100/60 px-1 rounded-sm">{name}</p> | ||
</div> | ||
</div> | ||
)); | ||
} |
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