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

webrtc-adapter

Package Overview
Dependencies
Maintainers
1
Versions
120
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

webrtc-adapter - npm Package Compare versions

Comparing version 0.0.4 to 0.0.5

38

adapter.js

@@ -43,2 +43,16 @@ /*jslint node:true*/

var sessionHasData = function(desc) {
if (!desc) {
return false;
}
var hasData = false;
var prefix = 'm=application';
desc.sdp.split('\n').forEach(function(line) {
if (line.slice(0, prefix.length) === prefix) {
hasData = true;
}
});
return hasData;
};
// Unify PeerConnection Object.

@@ -48,5 +62,25 @@ if (typeof RTCPeerConnection !== 'undefined') {

} else if (typeof mozRTCPeerConnection !== 'undefined') {
// Firefox uses 'url' rather than 'urls' for RTCIceServer.urls
myRTCPeerConnection = function (configuration, constraints) {
return new mozRTCPeerConnection(renameIceURLs(configuration), constraints);
// Firefox uses 'url' rather than 'urls' for RTCIceServer.urls
var pc = new mozRTCPeerConnection(renameIceURLs(configuration), constraints);
// Firefox doesn't fire 'onnegotiationneeded' when a data channel is created
// https://bugzilla.mozilla.org/show_bug.cgi?id=840728
var dataEnabled = false;
var boundCreateDataChannel = pc.createDataChannel.bind(pc);
pc.createDataChannel = function(label, dataChannelDict) {
var dc = boundCreateDataChannel(label, dataChannelDict);
if (!dataEnabled) {
dataEnabled = true;
if (pc.onnegotiationneeded &&
!sessionHasData(pc.localDescription) &&
!sessionHasData(pc.remoteDescription)) {
var event = new Event('negotiationneeded');
pc.onnegotiationneeded(event);
}
}
return dc;
};
return pc;
};

@@ -53,0 +87,0 @@ } else if (typeof webkitRTCPeerConnection !== 'undefined') {

2

package.json
{
"name": "webrtc-adapter",
"version": "0.0.4",
"version": "0.0.5",
"description": "Commonjs adapter.js browser compatibility shim for webRTC",

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

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