Skip to content

Commit 8c3acaf

Browse files
committed
Merge pull request #134 from jan-ivar/catchie8
s/.catch(f)/.then(null, f)/ to load on IE8
2 parents 0d75c47 + 3ecf4ce commit 8c3acaf

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

adapter.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ if (typeof window === 'undefined' || !window.navigator) {
219219
var orgEnumerateDevices =
220220
navigator.mediaDevices.enumerateDevices.bind(navigator.mediaDevices);
221221
navigator.mediaDevices.enumerateDevices = function() {
222-
return orgEnumerateDevices().catch(function(e) {
222+
return orgEnumerateDevices().then(undefined, function(e) {
223223
if (e.name === 'NotFoundError') {
224224
return [];
225225
}
@@ -498,11 +498,13 @@ function requestUserMedia(constraints) {
498498
}
499499

500500
var webrtcTesting = {};
501-
Object.defineProperty(webrtcTesting, 'version', {
502-
set: function(version) {
503-
webrtcDetectedVersion = version;
504-
}
505-
});
501+
try {
502+
Object.defineProperty(webrtcTesting, 'version', {
503+
set: function(version) {
504+
webrtcDetectedVersion = version;
505+
}
506+
});
507+
} catch (e) {}
506508

507509
if (typeof module !== 'undefined') {
508510
var RTCPeerConnection;

0 commit comments

Comments
 (0)