Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion lib/rtcpeerconnection/chrome.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,18 @@ function ChromeRTCPeerConnection(configuration, constraints) {
};

peerConnection.addStream(this._localStream);
util.proxyProperties(PeerConnection.prototype, this, peerConnection);

/*
* In Chrome's RTCPeerConnection class all methods and properties are
* non-inherited, but other implementaitons could implement RTCPeerConnection
* by inheriting EventTarget or other classes. So, we go through all
* super-classes
*/
var propList = Object.getPrototypeOf(peerConnection);
do {
util.proxyProperties(propList, this, peerConnection);
propList = Object.getPrototypeOf(propList);
} while (propList != null);
}

inherits(ChromeRTCPeerConnection, EventTarget);
Expand Down Expand Up @@ -320,6 +331,14 @@ ChromeRTCPeerConnection.prototype.setRemoteDescription = function setRemoteDescr
: promise;
};

ChromeRTCPeerConnection.prototype.getLocalStreams = function getLocalStreams() {
return this._peerConnection.getLocalStreams();
}

ChromeRTCPeerConnection.prototype.getRemoteStreams = function getRemoteStreams() {
return this._peerConnection.getRemoteStreams();
}

util.delegateMethods(
PeerConnection.prototype,
ChromeRTCPeerConnection.prototype,
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "@twilio/webrtc",
"version": "3.0.1-dev",
"__version": "3.0.1-dev",
"version" : "2.1.3",
"description": "WebRTC-related APIs and shims used by twilio-video.js",
"scripts": {
"build": "npm-run-all clean lint test",
Expand Down