rtcpeerconnection
Advanced tools
Comparing version 6.0.0 to 6.1.0
{ | ||
"name": "rtcpeerconnection", | ||
"version": "6.0.0", | ||
"version": "6.1.0", | ||
"description": "A tiny browser module that normalizes and simplifies the API for WebRTC peer connections.", | ||
@@ -5,0 +5,0 @@ "main": "rtcpeerconnection.js", |
@@ -120,6 +120,20 @@ var util = require('util'); | ||
this.addStream = this.pc.addStream.bind(this.pc); | ||
this.removeStream = this.pc.removeStream.bind(this.pc); | ||
this.removeStream = function (stream) { | ||
if (typeof self.pc.removeStream === 'function') { | ||
self.pc.removeStream.apply(self.pc, arguments); | ||
} else if (typeof self.pc.removeTrack === 'function') { | ||
stream.getTracks().forEach(function (track) { | ||
self.pc.removeTrack(track); | ||
}); | ||
} | ||
}; | ||
if (typeof this.pc.removeTrack === 'function') { | ||
this.removeTrack = this.pc.removeTrack.bind(this.pc); | ||
} | ||
// proxy some events directly | ||
this.pc.onremovestream = this.emit.bind(this, 'removeStream'); | ||
this.pc.onremovetrack = this.emit.bind(this, 'removeTrack'); | ||
this.pc.onaddstream = this.emit.bind(this, 'addStream'); | ||
@@ -126,0 +140,0 @@ this.pc.onnegotiationneeded = this.emit.bind(this, 'negotiationNeeded'); |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
280340
7614