Created
October 2, 2020 17:34
-
-
Save gkio/ebf113c79974be46f7c4baf2ddee0d71 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
import { | |
useRosterState, | |
useAttendeeStatus, | |
} from 'amazon-chime-sdk-component-library-react'; | |
const useMeetingAttendees = () => { | |
const { roster } = useRosterState(); | |
return Object.values(roster).map((attendee) => { | |
const { chimeAttendeeId, externalUserId } = attendee; | |
const name = externalUserId.split('#')[1]; | |
const { | |
videoEnabled, | |
muted, | |
signalStrength, | |
} = useAttendeeStatus(chimeAttendeeId); | |
return { | |
name, | |
videoEnabled, | |
muted, | |
signalStrength, | |
chimeAttendeeId, | |
}; | |
}); | |
}; | |
export default useMeetingAttendees; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment