Skip to content

Commit

Permalink
Fix datachannel test running on PS4 and certain Samsung TVs (Moderniz…
Browse files Browse the repository at this point in the history
  • Loading branch information
guilhermesimoes authored Sep 4, 2020
1 parent ee2cc21 commit 461321e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions feature-detects/webrtc/datachannel.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,12 @@ define(['Modernizr', 'prefixed', 'domPrefixesAll', 'test/webrtc/peerconnection']
for (var i = 0, len = domPrefixesAll.length; i < len; i++) {
var PeerConnectionConstructor = window[domPrefixesAll[i] + 'RTCPeerConnection'];
if (PeerConnectionConstructor) {
var peerConnection = new PeerConnectionConstructor(null);
return 'createDataChannel' in peerConnection;
// Wrapped in a try catch to avoid "Error creating RTCPeerConnection" #2599 & #2221
try {
var peerConnection = new PeerConnectionConstructor({});
return 'createDataChannel' in peerConnection;
} catch (e) {
}
}
}
return false;
Expand Down

0 comments on commit 461321e

Please sign in to comment.