Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

rtcpeerconnection

Package Overview
Dependencies
Maintainers
4
Versions
83
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rtcpeerconnection - npm Package Compare versions

Comparing version 2.6.2 to 2.6.3

2

package.json
{
"name": "rtcpeerconnection",
"version": "2.6.2",
"version": "2.6.3",
"description": "A tiny browser module that normalizes and simplifies the API for WebRTC peer connections.",

@@ -5,0 +5,0 @@ "main": "rtcpeerconnection.js",

@@ -16,2 +16,14 @@ var _ = require('underscore');

// make sure this only gets enabled in Google Chrome
this.enableChromeNativeSimulcast = false;
if (constraints && constraints.optional &&
webrtc.prefix === 'webkit' &&
navigator.appVersion.match(/Chromium\//) === null) {
constraints.optional.forEach(function (constraint, idx) {
if (constraint.enableChromeNativeSimulcast) {
self.enableChromeNativeSimulcast = true;
}
});
}
this.pc = new peerconn(config, constraints);

@@ -237,2 +249,9 @@

if (offer.jingle) {
if (this.enableChromeNativeSimulcast) {
offer.jingle.contents.forEach(function (content) {
if (content.name === 'video') {
content.description.googConferenceFlag = true;
}
});
}
offer.sdp = SJJ.toSessionSDP(offer.jingle, self.config.sdpSessionID);

@@ -318,28 +337,27 @@ self.remoteDescription = offer.jingle;

}
// make sure this only gets enabled in Google Chrome
var enableChromeNativeSimulcast = (constraints.enableChromeNativeSimulcast &&
webrtc.prefix === 'webkit' &&
navigator.appVersion.match(/Chromium\//) === null) || false;
delete constraints.enableChromeNativeSimulcast;
self.pc.createAnswer(
function (answer) {
var sim = [];
if (enableChromeNativeSimulcast) {
if (self.enableChromeNativeSimulcast) {
// native simulcast part 1: add another SSRC
answer.jingle = SJJ.toSessionJSON(answer.sdp);
if (answer.jingle.contents.length >= 2 && answer.jingle.contents[1].name === 'video') {
var newssrc = JSON.parse(JSON.stringify(answer.jingle.contents[1].description.sources[0]));
newssrc.ssrc = '' + Math.floor(Math.random() * 0xffffffff); // FIXME: look for conflicts
answer.jingle.contents[1].description.sources.push(newssrc);
var hasSimgroup = false;
var groups = answer.jingle.contents[1].description.sourceGroups || [];
if (groups.length === 0) { // FIXME: should check for SIM group exist
var newssrc = JSON.parse(JSON.stringify(answer.jingle.contents[1].description.sources[0]));
newssrc.ssrc = '' + Math.floor(Math.random() * 0xffffffff); // FIXME: look for conflicts
answer.jingle.contents[1].description.sources.push(newssrc);
answer.jingle.contents[1].description.sources.forEach(function (source) {
sim.push(source.ssrc);
});
answer.jingle.contents[1].description.sourceGroups = [
{
semantics: 'SIM',
sources: sim
}
];
answer.sdp = SJJ.toSessionSDP(answer.jingle, self.config.sdpSessionID);
answer.jingle.contents[1].description.sources.forEach(function (source) {
sim.push(source.ssrc);
});
answer.jingle.contents[1].description.sourceGroups = [
{
semantics: 'SIM',
sources: sim
}
];
answer.sdp = SJJ.toSessionSDP(answer.jingle, self.config.sdpSessionID);
}
}

@@ -359,3 +377,3 @@ }

}
if (enableChromeNativeSimulcast) {
if (self.enableChromeNativeSimulcast) {
// native simulcast part 2:

@@ -362,0 +380,0 @@ // signal multiple tracks to the receiver

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc