Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function initializePeersFirstCall() {
// 受け側
peer2 = new Peer(config);
peer2
.on("call", (call) => {
call.answer(null, {
audioBandwidth: AUDIO_BANDWIDTH, // max audio bandwidth (kbps)
videoBandwidth: Number($("#videoBandwidth").val()), // max video bandwidth (kbps)
});
call
.on("stream", (peerStream) => {
console.log("received stream");
// videoタグに設定
streamUrl = URL.createObjectURL(peerStream);
$("#video").attr("src", streamUrl);
});
});
peer2
.on("open", (p2id) => {
peer2id = p2id;
// 送り側
peer1 = new Peer(config);
peer1
.on("open", (p1id) => {
makeNewCall();
});
});
}