nice showing streams of both people

cannot addStream before the full connection process has happened? otherwise keep getting race conditions? idk why honestly
This commit is contained in:
talksik
2022-05-19 09:08:33 -05:00
parent 3e957c2296
commit 8ee150d694
4 changed files with 45 additions and 24 deletions
@@ -144,10 +144,12 @@ export default function LineDetails() {
{/* live line */}
<div className="flex flex-col">
{Object.values(peerMap).map((linePeers, index) => {
return linePeers.map((linePeer) => {
return <StreamPlayer key={`streamPlayer-${index}`} peer={linePeer.peer} />;
});
{Object.keys(peerMap).map((lineId, index) => {
if (lineId !== selectedLine.lineDetails._id.toString()) return <></>;
return peerMap[lineId].map((linePeer) => (
<StreamPlayer key={`streamPlayer-${index}`} peer={linePeer.peer} />
));
})}
</div>