Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
before(async () => {
const constraints = { audio: true, video: true };
stream = await makeStream(constraints);
pc1 = new RTCPeerConnection({ iceServers: [] });
pc1.addStream(stream);
trackIdsToAttributes = new Map();
const offerOptions = { offerToReceiveAudio: true, offerToReceiveVideo: true };
const offer = await pc1.createOffer(offerOptions);
offer1 = new RTCSessionDescription({
type: offer.type,
sdp: setSimulcast(offer.sdp, sdpFormat, trackIdsToAttributes)
});
await pc1.setLocalDescription(offer1);
assert.equal(pc1.signalingState, 'have-local-offer');
const _offer = await pc1.createOffer(offerOptions);
offer2 = new RTCSessionDescription({
before(async () => {
const constraints = { audio: true, video: true };
stream = await makeStream(constraints);
pc1 = new RTCPeerConnection({ iceServers: [] });
pc1.addStream(stream);
pc2 = new RTCPeerConnection({ iceServers: [] });
pc2.addStream(stream);
trackIdsToAttributes = new Map();
const offerOptions = { offerToReceiveAudio: true, offerToReceiveVideo: true };
const offer = await pc1.createOffer(offerOptions);
offer1 = createSdp === 'createOffer' ? new RTCSessionDescription({
type: offer.type,
sdp: setSimulcast(offer.sdp, sdpFormat, trackIdsToAttributes)
}) : offer;
await pc1.setLocalDescription(offer1);
await pc2.setRemoteDescription(offer1);
const answer = await pc2.createAnswer();
before(async () => {
const constraints = { audio: true, video: true };
stream = await makeStream(constraints);
pc1 = new RTCPeerConnection({ iceServers: [] });
pc1.addStream(stream);
pc2 = new RTCPeerConnection({ iceServers: [] });
pc2.addStream(stream);
trackIdsToAttributes = new Map();
const offerOptions = { offerToReceiveAudio: true, offerToReceiveVideo: true };
const offer = await pc1.createOffer(offerOptions);
offer1 = createSdp === 'createOffer' ? new RTCSessionDescription({
type: offer.type,
sdp: setSimulcast(offer.sdp, sdpFormat, trackIdsToAttributes)
}) : offer;
await pc1.setLocalDescription(offer1);
await pc2.setRemoteDescription(offer1);
const answer = await pc2.createAnswer();
answer1 = createSdp === 'createAnswer' ? new RTCSessionDescription({