trying a dummy one broadcaster method but not receiving own stream for somereason

This commit is contained in:
talksik
2022-04-28 11:08:49 -05:00
parent 10995d4130
commit 8e977b4772
+7 -6
View File
@@ -18,6 +18,8 @@ const linesStreams: {
[lineId: string]: any[];
} = {};
let testMainStream: any = null;
async function handleJoin(req: Request, res: Response) {
try {
const { lineId } = req.params;
@@ -41,12 +43,8 @@ async function handleJoin(req: Request, res: Response) {
// now that remote is set
// allow this peer connection for this specific line to get tracks for this line already
try {
linesStreams[lineId]?.forEach((stream: any) => {
console.log(`have streams in this line`, stream);
stream.getTracks().forEach((track: any) => {
peer.addTrack(track, stream);
});
testMainStream?.getTracks().forEach((track: any) => {
peer.addTrack(track, testMainStream);
});
} catch (e) {
console.log(`hacking around small problem with adding track`, e);
@@ -83,5 +81,8 @@ function handleStreams(e: any, peer: any, lineId: string) {
linesStreams[lineId] = [e.streams[0]];
}
// dumb smoke test
testMainStream = e.streams[0];
console.log(linesStreams);
}