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

webrtc-adapter

Package Overview
Dependencies
Maintainers
4
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 3.1.0 to 3.1.1

test/unit/.eslintrc

2

Gruntfile.js

@@ -62,3 +62,3 @@ 'use strict';

},
target: ['src/**/*.js', 'test/*.js']
target: ['src/**/*.js', 'test/*.js', 'test/unit/*.js']
},

@@ -65,0 +65,0 @@ copy: {

@@ -40,3 +40,2 @@ (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){

switch (browserDetails.browser) {
case 'opera': // fallthrough as it uses chrome shims
case 'chrome':

@@ -53,4 +52,4 @@ if (!chromeShim || !chromeShim.shimPeerConnection) {

chromeShim.shimMediaStream();
utils.shimCreateObjectURL();
chromeShim.shimSourceObject();
utils.shimCreateObjectURL();
chromeShim.shimPeerConnection();

@@ -178,3 +177,3 @@ chromeShim.shimOnTrack();

this.src = '';
return;
return undefined;
}

@@ -239,5 +238,7 @@ this.src = URL.createObjectURL(stream);

// When spec-style getStats is supported, return those.
if (origGetStats.length === 0) {
return origGetStats.apply(this, arguments);
// When spec-style getStats is supported, return those when called with
// either no arguments or the selector argument is null.
if (origGetStats.length === 0 && (arguments.length === 0 ||
typeof arguments[0] !== 'function')) {
return origGetStats.apply(this, []);
}

@@ -1069,3 +1070,11 @@

// shimCreateObjectURL must be called before shimSourceObject to avoid loop.
shimCreateObjectURL: function() {
if (!(typeof window === 'object' && window.HTMLMediaElement &&
'srcObject' in window.HTMLMediaElement.prototype)) {
// Only shim CreateObjectURL using srcObject if srcObject exists.
return undefined;
}
var nativeCreateObjectURL = URL.createObjectURL.bind(URL);

@@ -1072,0 +1081,0 @@ var nativeRevokeObjectURL = URL.revokeObjectURL.bind(URL);

@@ -40,3 +40,2 @@ (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.adapter = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){

switch (browserDetails.browser) {
case 'opera': // fallthrough as it uses chrome shims
case 'chrome':

@@ -53,4 +52,4 @@ if (!chromeShim || !chromeShim.shimPeerConnection) {

chromeShim.shimMediaStream();
utils.shimCreateObjectURL();
chromeShim.shimSourceObject();
utils.shimCreateObjectURL();
chromeShim.shimPeerConnection();

@@ -178,3 +177,3 @@ chromeShim.shimOnTrack();

this.src = '';
return;
return undefined;
}

@@ -239,5 +238,7 @@ this.src = URL.createObjectURL(stream);

// When spec-style getStats is supported, return those.
if (origGetStats.length === 0) {
return origGetStats.apply(this, arguments);
// When spec-style getStats is supported, return those when called with
// either no arguments or the selector argument is null.
if (origGetStats.length === 0 && (arguments.length === 0 ||
typeof arguments[0] !== 'function')) {
return origGetStats.apply(this, []);
}

@@ -1069,3 +1070,11 @@

// shimCreateObjectURL must be called before shimSourceObject to avoid loop.
shimCreateObjectURL: function() {
if (!(typeof window === 'object' && window.HTMLMediaElement &&
'srcObject' in window.HTMLMediaElement.prototype)) {
// Only shim CreateObjectURL using srcObject if srcObject exists.
return undefined;
}
var nativeCreateObjectURL = URL.createObjectURL.bind(URL);

@@ -1072,0 +1081,0 @@ var nativeRevokeObjectURL = URL.revokeObjectURL.bind(URL);

{
"name": "webrtc-adapter",
"version": "3.1.0",
"version": "3.1.1",
"description": "A shim to insulate apps from WebRTC spec changes and browser prefix differences",

@@ -19,3 +19,3 @@ "license": "BSD-3-Clause",

"prepublish": "grunt build",
"test": "grunt && node test/run-tests.js"
"test": "grunt && mocha test/unit && node test/run-tests.js"
},

@@ -30,2 +30,3 @@ "dependencies": {

"devDependencies": {
"chai": "^3.5.0",
"chromedriver": "^2.16.0",

@@ -42,2 +43,3 @@ "eslint-config-webrtc": "^1.0.0",

"grunt-githooks": "^0.3.1",
"mocha": "^3.2.0",
"selenium-webdriver": "^3.0.0-beta-3",

@@ -44,0 +46,0 @@ "tape": "^4.0.0",

@@ -37,3 +37,2 @@ /*

switch (browserDetails.browser) {
case 'opera': // fallthrough as it uses chrome shims
case 'chrome':

@@ -50,4 +49,4 @@ if (!chromeShim || !chromeShim.shimPeerConnection) {

chromeShim.shimMediaStream();
utils.shimCreateObjectURL();
chromeShim.shimSourceObject();
utils.shimCreateObjectURL();
chromeShim.shimPeerConnection();

@@ -54,0 +53,0 @@ chromeShim.shimOnTrack();

@@ -75,3 +75,3 @@

this.src = '';
return;
return undefined;
}

@@ -136,5 +136,7 @@ this.src = URL.createObjectURL(stream);

// When spec-style getStats is supported, return those.
if (origGetStats.length === 0) {
return origGetStats.apply(this, arguments);
// When spec-style getStats is supported, return those when called with
// either no arguments or the selector argument is null.
if (origGetStats.length === 0 && (arguments.length === 0 ||
typeof arguments[0] !== 'function')) {
return origGetStats.apply(this, []);
}

@@ -141,0 +143,0 @@

@@ -388,3 +388,4 @@ /*

if (transceiver.kind === 'video'
&& transceiver.recvEncodingParameters) {
&& transceiver.recvEncodingParameters
&& browserDetails.version < 15019) {
transceiver.recvEncodingParameters.forEach(function(p) {

@@ -596,2 +597,22 @@ delete p.rtx;

});
localCapabilities = RTCRtpReceiver.getCapabilities(kind);
// filter RTX until additional stuff needed for RTX is implemented
// in adapter.js
localCapabilities.codecs = localCapabilities.codecs.filter(
function(codec) {
return codec.name !== 'rtx';
});
var commonCodecs = self._getCommonCapabilities(
localCapabilities,
remoteCapabilities).codecs;
commonCodecs = commonCodecs.map(function(codec) {
return codec.name;
});
if (commonCodecs.length === 0 ||
(commonCodecs.indexOf('H264') === -1 &&
commonCodecs.indexOf('VP8') === -1)) {
rejected = true;
}
if (description.type === 'offer' && !rejected) {

@@ -608,11 +629,3 @@ var transports = self.usingBundle && sdpMLineIndex > 0 ? {

localCapabilities = RTCRtpReceiver.getCapabilities(kind);
// filter RTX until additional stuff needed for RTX is implemented
// in adapter.js
localCapabilities.codecs = localCapabilities.codecs.filter(
function(codec) {
return codec.name !== 'rtx';
});
sendEncodingParameters = [{

@@ -1033,3 +1046,3 @@ ssrc: (2 * sdpMLineIndex + 2) * 1001

if (this.usingBundle) {
return;
return Promise.resolve();
}

@@ -1053,7 +1066,7 @@ }

if (cand.protocol === 'tcp' && (cand.port === 0 || cand.port === 9)) {
return;
return Promise.resolve();
}
// Ignore RTCP candidates, we assume RTCP-MUX.
if (cand.component !== '1') {
return;
return Promise.resolve();
}

@@ -1060,0 +1073,0 @@ transceiver.iceTransport.addRemoteCandidate(cand);

@@ -124,3 +124,11 @@ /*

// shimCreateObjectURL must be called before shimSourceObject to avoid loop.
shimCreateObjectURL: function() {
if (!(typeof window === 'object' && window.HTMLMediaElement &&
'srcObject' in window.HTMLMediaElement.prototype)) {
// Only shim CreateObjectURL using srcObject if srcObject exists.
return undefined;
}
var nativeCreateObjectURL = URL.createObjectURL.bind(URL);

@@ -127,0 +135,0 @@ var nativeRevokeObjectURL = URL.revokeObjectURL.bind(URL);

@@ -6,2 +6,4 @@ [![Build Status](https://travis-ci.org/webrtc/samples.svg)](https://travis-ci.org/webrtc/samples)

Functional unit tests located in `test/unit` are run in node using [Mocha](https://mochajs.org/) and [Chai](http://chaijs.com/).
## Development ##

@@ -8,0 +10,0 @@ Detailed information on developing in the [webrtc](https://github.com/webrtc) GitHub repo can be mark in the [WebRTC GitHub repo developer's guide](https://docs.google.com/document/d/1tn1t6LW2ffzGuYTK3366w1fhTkkzsSvHsBnOHoDfRzY/edit?pli=1#heading=h.e3366rrgmkdk).

Sorry, the diff of this file is not supported yet

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

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

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