webrtc-adapter
Advanced tools
Comparing version 2.0.6 to 2.0.7
{ | ||
"name": "webrtc-adapter", | ||
"version": "2.0.6", | ||
"version": "2.0.7", | ||
"description": "A shim to insulate apps from WebRTC spec changes and browser prefix differences", | ||
@@ -5,0 +5,0 @@ "license": "BSD-3-Clause", |
@@ -32,2 +32,14 @@ /* | ||
} | ||
// this adds an additional event listener to MediaStrackTrack that signals | ||
// when a tracks enabled property was changed. | ||
var origMSTEnabled = Object.getOwnPropertyDescriptor( | ||
MediaStreamTrack.prototype, 'enabled'); | ||
Object.defineProperty(MediaStreamTrack.prototype, 'enabled', { | ||
set: function(value) { | ||
origMSTEnabled.set.call(this, value); | ||
var ev = new Event('enabled'); | ||
ev.enabled = value; | ||
this.dispatchEvent(ev); | ||
} | ||
}); | ||
} | ||
@@ -173,3 +185,10 @@ | ||
// to two different senders does not work (build 10547). | ||
this.localStreams.push(stream.clone()); | ||
var clonedStream = stream.clone(); | ||
stream.getTracks().forEach(function(track, idx) { | ||
var clonedTrack = clonedStream.getTracks()[idx]; | ||
track.addEventListener('enabled', function(event) { | ||
clonedTrack.enabled = event.enabled; | ||
}); | ||
}); | ||
this.localStreams.push(clonedStream); | ||
this._maybeFireNegotiationNeeded(); | ||
@@ -176,0 +195,0 @@ }; |
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
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
436670
11212