Last active
March 19, 2021 23:07
-
-
Save kimberleehowley/540a78ebb9e3c3aed5cacabea0d47567 to your computer and use it in GitHub Desktop.
Map over call state to determine how many tiles to display
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
// In callState.js | |
function getCallItems(participants) { | |
let callItems = { ...initialCallState.callItems }; // Ensure we *always* have a local participant | |
for (const [id, participant] of Object.entries(participants)) { | |
callItems[id] = { | |
videoTrackState: participant.tracks.video, | |
audioTrackState: participant.tracks.audio, | |
}; | |
if (shouldIncludeScreenCallItem(participant)) { | |
callItems[id + '-screen'] = { | |
videoTrackState: participant.tracks.screenVideo, | |
audioTrackState: participant.tracks.screenAudio, | |
}; | |
} | |
} | |
return callItems; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment