Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
sections.forEach(function(mediaSection, sdpMLineIndex) {
var lines = SDPUtils.splitLines(mediaSection);
var kind = SDPUtils.getKind(mediaSection);
var rejected = SDPUtils.isRejected(mediaSection);
var protocol = lines[0].substr(2).split(' ')[2];
var direction = SDPUtils.getDirection(mediaSection, sessionpart);
var remoteMsid = SDPUtils.parseMsid(mediaSection);
var mid = SDPUtils.getMid(mediaSection) || SDPUtils.generateIdentifier();
// Reject datachannels which are not implemented yet.
if (kind === 'application' && protocol === 'DTLS/SCTP') {
self.transceivers[sdpMLineIndex] = {
mid: mid,
isDatachannel: true
};
return;
}
var transceiver;
var iceGatherer;
var iceTransport;
var dtlsTransport;
var rtpReceiver;
var sendEncodingParameters;
sections.forEach(function(mediaSection, sdpMLineIndex) {
var lines = SDPUtils.splitLines(mediaSection);
var kind = SDPUtils.getKind(mediaSection);
var rejected = SDPUtils.isRejected(mediaSection);
var protocol = lines[0].substr(2).split(' ')[2];
var direction = SDPUtils.getDirection(mediaSection, sessionpart);
var remoteMsid = SDPUtils.parseMsid(mediaSection);
var mid = SDPUtils.getMid(mediaSection) || SDPUtils.generateIdentifier();
// Reject datachannels which are not implemented yet.
if (kind === 'application' && protocol === 'DTLS/SCTP') {
self.transceivers[sdpMLineIndex] = {
mid: mid,
isDatachannel: true
};
return;
}
var transceiver;
var iceGatherer;
var iceTransport;
var dtlsTransport;
var rtpReceiver;
var sendEncodingParameters;
sections.forEach(function(mediaSection, sdpMLineIndex) {
var lines = SDPUtils.splitLines(mediaSection);
var kind = SDPUtils.getKind(mediaSection);
var rejected = SDPUtils.isRejected(mediaSection);
var protocol = lines[0].substr(2).split(' ')[2];
var direction = SDPUtils.getDirection(mediaSection, sessionpart);
var remoteMsid = SDPUtils.parseMsid(mediaSection);
var mid = SDPUtils.getMid(mediaSection) || SDPUtils.generateIdentifier();
// Reject datachannels which are not implemented yet.
if (kind === 'application' && protocol === 'DTLS/SCTP') {
self.transceivers[sdpMLineIndex] = {
mid: mid,
isDatachannel: true
};
return;
}
var transceiver;
var iceGatherer;
var iceTransport;
var dtlsTransport;
var rtpReceiver;
var sendEncodingParameters;
sections.forEach(function(mediaSection, sdpMLineIndex) {
var lines = SDPUtils.splitLines(mediaSection);
var kind = SDPUtils.getKind(mediaSection);
var rejected = SDPUtils.isRejected(mediaSection);
var protocol = lines[0].substr(2).split(' ')[2];
var direction = SDPUtils.getDirection(mediaSection, sessionpart);
var remoteMsid = SDPUtils.parseMsid(mediaSection);
var mid = SDPUtils.getMid(mediaSection) || SDPUtils.generateIdentifier();
// Reject datachannels which are not implemented yet.
if (kind === 'application' && protocol === 'DTLS/SCTP') {
self.transceivers[sdpMLineIndex] = {
mid: mid,
isDatachannel: true
};
return;
}
var transceiver;
var iceGatherer;
var iceTransport;
var dtlsTransport;
var rtpReceiver;
var sendEncodingParameters;
const results = ((content.transport! as JingleIce).candidates || []).map(async json => {
const candidate = SDPUtils.writeCandidate(convertCandidateToIntermediate(json));
let sdpMLineIndex!: number;
// workaround for https://bugzilla.mozilla.org/show_bug.cgi?id=1456417
const remoteSDP = this.pc.remoteDescription!.sdp;
const mediaSections = SDPUtils.getMediaSections(remoteSDP);
for (let i = 0; i < mediaSections.length; i++) {
if (SDPUtils.getMid(mediaSections[i]) === sdpMid) {
sdpMLineIndex = i;
break;
}
}
if (this.pc.signalingState === 'stable') {
try {
await this.pc.addIceCandidate({ sdpMid, sdpMLineIndex, candidate });
} catch (err) {
this._log('error', 'Could not add ICE candidate', err);
}
} else {
this.candidateBuffer.push({ sdpMid, sdpMLineIndex, candidate });
}
});
return Promise.all(results);
const semantics = parts.shift()!.substr(8);
session.groups.push({
mids: parts,
semantics
});
}
for (const mediaSection of mediaSections) {
const kind = SDP.getKind(mediaSection);
const isRejected = SDP.isRejected(mediaSection);
const mLine = SDP.parseMLine(mediaSection);
const media: IntermediateMediaDescription = {
direction: SDP.getDirection(mediaSection, sessionPart),
kind,
mid: SDP.getMid(mediaSection),
protocol: mLine.protocol
// TODO: what about end-of-candidates?
};
if (!isRejected) {
media.iceParameters = SDP.getIceParameters(mediaSection, sessionPart);
media.dtlsParameters = SDP.getDtlsParameters(mediaSection, sessionPart);
media.setup = SDP.matchPrefix(mediaSection, 'a=setup:')[0].substr(8);
}
if (kind === 'audio' || kind === 'video') {
media.rtpParameters = SDP.parseRtpParameters(mediaSection);
media.rtpEncodingParameters = SDP.parseRtpEncodingParameters(mediaSection);
media.rtcpParameters = SDP.parseRtcpParameters(mediaSection);
const msid = SDP.parseMsid(mediaSection);
media.streams = msid ? [msid] : [];