Skip to content

Commit

Permalink
accept any track type (#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
cacheonly authored Nov 27, 2023
1 parent 7ff9ea3 commit b8185d0
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/components/stream-player.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,9 @@ interface Props {
export default function StreamPlayerWrapper({ streamerIdentity }: Props) {
const connectionState = useConnectionState();
const participant = useRemoteParticipant(streamerIdentity);
const tracks = useTracks([
Track.Source.Camera,
Track.Source.Microphone,
]).filter((track) => track.participant.identity === streamerIdentity);
const tracks = useTracks(Object.values(Track.Source)).filter(
(track) => track.participant.identity === streamerIdentity
);

if (connectionState !== ConnectionState.Connected || !participant) {
return (
Expand Down Expand Up @@ -74,8 +73,7 @@ export const StreamPlayer = ({ participant }: { participant: Participant }) => {
const videoEl = useRef<HTMLVideoElement>(null);
const playerEl = useRef<HTMLDivElement>(null);

// useTracks([Track.Source.Camera, Track.Source.Microphone])
useTracks([Track.Source.Camera])
useTracks(Object.values(Track.Source))
.filter((track) => track.participant.identity === participant.identity)
.forEach((track) => {
if (videoEl.current) {
Expand Down

1 comment on commit b8185d0

@vercel
Copy link

@vercel vercel bot commented on b8185d0 Nov 27, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.