webrtcsupport
Advanced tools
Comparing version 0.5.0 to 0.6.0
{ | ||
"name": "webrtcsupport", | ||
"version": "0.5.0", | ||
"version": "0.6.0", | ||
"description": "Browser module to detect support for webrtc and extract proper constructors.", | ||
@@ -5,0 +5,0 @@ "main": "webrtcsupport.js", |
(function(e){if("function"==typeof bootstrap)bootstrap("webrtcsupport",e);else if("object"==typeof exports)module.exports=e();else if("function"==typeof define&&define.amd)define(e);else if("undefined"!=typeof ses){if(!ses.ok())return;ses.makeWebrtcsupport=e}else"undefined"!=typeof window?window.webrtcsupport=e():global.webrtcsupport=e()})(function(){var define,ses,bootstrap,module,exports; | ||
return (function(e,t,n){function i(n,s){if(!t[n]){if(!e[n]){var o=typeof require=="function"&&require;if(!s&&o)return o(n,!0);if(r)return r(n,!0);throw new Error("Cannot find module '"+n+"'")}var u=t[n]={exports:{}};e[n][0].call(u.exports,function(t){var r=e[n][1][t];return i(r?r:t)},u,u.exports)}return t[n].exports}var r=typeof require=="function"&&require;for(var s=0;s<n.length;s++)i(n[s]);return i})({1:[function(require,module,exports){ | ||
// created by @HenrikJoreteg | ||
var PC = window.mozRTCPeerConnection || window.webkitRTCPeerConnection || window.RTCPeerConnection; | ||
var IceCandidate = window.mozRTCIceCandidate || window.RTCIceCandidate; | ||
var SessionDescription = window.mozRTCSessionDescription || window.RTCSessionDescription; | ||
var prefix = function () { | ||
if (window.mozRTCPeerConnection) { | ||
return 'moz'; | ||
} else if (window.webkitRTCPeerConnection) { | ||
return 'webkit'; | ||
} | ||
}(); | ||
var prefix; | ||
var isChrome = false; | ||
var isFirefox = false; | ||
var ua = navigator.userAgent.toLowerCase(); | ||
// basic sniffing | ||
if (ua.indexOf('firefox') !== -1) { | ||
prefix = 'moz'; | ||
isFirefox = true; | ||
} else if (ua.indexOf('chrome') !== -1) { | ||
prefix = 'webkit'; | ||
isChrome = true; | ||
} | ||
var PC = window.mozRTCPeerConnection || window.webkitRTCPeerConnection; | ||
var IceCandidate = window.RTCIceCandidate || window.mozRTCIceCandidate; | ||
var SessionDescription = window.RTCSessionDescription || window.mozRTCSessionDescription; | ||
var MediaStream = window.webkitMediaStream || window.MediaStream; | ||
@@ -18,10 +25,11 @@ var screenSharing = navigator.userAgent.match('Chrome') && parseInt(navigator.userAgent.match(/Chrome\/(.*) /)[1], 10) >= 26; | ||
// export support flags and constructors.prototype && PC | ||
module.exports = { | ||
support: !!PC, | ||
dataChannel: !!(PC && PC.prototype && PC.prototype.createDataChannel), | ||
dataChannel: isChrome || isFirefox || (PC.prototype && PC.prototype.createDataChannel), | ||
prefix: prefix, | ||
webAudio: !!(AudioContext && AudioContext.prototype.createMediaStreamSource), | ||
mediaStream: !!(MediaStream && MediaStream.prototype.removeTrack), | ||
screenSharing: screenSharing, | ||
screenSharing: !!screenSharing, | ||
AudioContext: AudioContext, | ||
@@ -28,0 +36,0 @@ PeerConnection: PC, |
// created by @HenrikJoreteg | ||
var PC = window.mozRTCPeerConnection || window.webkitRTCPeerConnection || window.RTCPeerConnection; | ||
var IceCandidate = window.mozRTCIceCandidate || window.RTCIceCandidate; | ||
var SessionDescription = window.mozRTCSessionDescription || window.RTCSessionDescription; | ||
var prefix = function () { | ||
if (window.mozRTCPeerConnection) { | ||
return 'moz'; | ||
} else if (window.webkitRTCPeerConnection) { | ||
return 'webkit'; | ||
} | ||
}(); | ||
var prefix; | ||
var isChrome = false; | ||
var isFirefox = false; | ||
var ua = navigator.userAgent.toLowerCase(); | ||
// basic sniffing | ||
if (ua.indexOf('firefox') !== -1) { | ||
prefix = 'moz'; | ||
isFirefox = true; | ||
} else if (ua.indexOf('chrome') !== -1) { | ||
prefix = 'webkit'; | ||
isChrome = true; | ||
} | ||
var PC = window.mozRTCPeerConnection || window.webkitRTCPeerConnection; | ||
var IceCandidate = window.RTCIceCandidate || window.mozRTCIceCandidate; | ||
var SessionDescription = window.RTCSessionDescription || window.mozRTCSessionDescription; | ||
var MediaStream = window.webkitMediaStream || window.MediaStream; | ||
@@ -16,10 +23,11 @@ var screenSharing = navigator.userAgent.match('Chrome') && parseInt(navigator.userAgent.match(/Chrome\/(.*) /)[1], 10) >= 26; | ||
// export support flags and constructors.prototype && PC | ||
module.exports = { | ||
support: !!PC, | ||
dataChannel: !!(PC && PC.prototype && PC.prototype.createDataChannel), | ||
dataChannel: isChrome || isFirefox || (PC.prototype && PC.prototype.createDataChannel), | ||
prefix: prefix, | ||
webAudio: !!(AudioContext && AudioContext.prototype.createMediaStreamSource), | ||
mediaStream: !!(MediaStream && MediaStream.prototype.removeTrack), | ||
screenSharing: screenSharing, | ||
screenSharing: !!screenSharing, | ||
AudioContext: AudioContext, | ||
@@ -26,0 +34,0 @@ PeerConnection: PC, |
Sorry, the diff of this file is not supported yet
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
6440
74