trying a dummy one broadcaster method but not receiving own stream for somereason
This commit is contained in:
@@ -18,6 +18,8 @@ const linesStreams: {
|
|||||||
[lineId: string]: any[];
|
[lineId: string]: any[];
|
||||||
} = {};
|
} = {};
|
||||||
|
|
||||||
|
let testMainStream: any = null;
|
||||||
|
|
||||||
async function handleJoin(req: Request, res: Response) {
|
async function handleJoin(req: Request, res: Response) {
|
||||||
try {
|
try {
|
||||||
const { lineId } = req.params;
|
const { lineId } = req.params;
|
||||||
@@ -41,12 +43,8 @@ async function handleJoin(req: Request, res: Response) {
|
|||||||
// now that remote is set
|
// now that remote is set
|
||||||
// allow this peer connection for this specific line to get tracks for this line already
|
// allow this peer connection for this specific line to get tracks for this line already
|
||||||
try {
|
try {
|
||||||
linesStreams[lineId]?.forEach((stream: any) => {
|
testMainStream?.getTracks().forEach((track: any) => {
|
||||||
console.log(`have streams in this line`, stream);
|
peer.addTrack(track, testMainStream);
|
||||||
|
|
||||||
stream.getTracks().forEach((track: any) => {
|
|
||||||
peer.addTrack(track, stream);
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.log(`hacking around small problem with adding track`, 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]];
|
linesStreams[lineId] = [e.streams[0]];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// dumb smoke test
|
||||||
|
testMainStream = e.streams[0];
|
||||||
|
|
||||||
console.log(linesStreams);
|
console.log(linesStreams);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user