Skip to content

Commit a46d99d

Browse files
committed
Merge pull request #127 from fippo/firefox-forward-compat
Firefox: check if RTCSessionDescription and RTCIceCandidate exist before overwriting them
2 parents c511901 + a34a43f commit a46d99d

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

adapter.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,10 +127,14 @@ if (typeof window === 'undefined' || !window.navigator) {
127127
};
128128

129129
// The RTCSessionDescription object.
130-
window.RTCSessionDescription = mozRTCSessionDescription;
130+
if (!window.RTCSessionDescription) {
131+
window.RTCSessionDescription = mozRTCSessionDescription;
132+
}
131133

132134
// The RTCIceCandidate object.
133-
window.RTCIceCandidate = mozRTCIceCandidate;
135+
if (!window.RTCIceCandidate) {
136+
window.RTCIceCandidate = mozRTCIceCandidate;
137+
}
134138

135139
// getUserMedia constraints shim.
136140
getUserMedia = function(constraints, onSuccess, onError) {

0 commit comments

Comments
 (0)