webrtcsupport
Advanced tools
Comparing version 1.2.6 to 1.3.0
// created by @HenrikJoreteg | ||
var prefix; | ||
var version; | ||
if (window.mozRTCPeerConnection || navigator.mozGetUserMedia) { | ||
prefix = 'moz'; | ||
version = parseInt(navigator.userAgent.match(/Firefox\/([0-9]+)\./)[1], 10); | ||
} else if (window.webkitRTCPeerConnection || navigator.webkitGetUserMedia) { | ||
prefix = 'webkit'; | ||
version = parseInt(navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./)[2], 10); | ||
} | ||
@@ -15,4 +18,4 @@ | ||
var screenSharing = window.location.protocol === 'https:' && | ||
((window.navigator.userAgent.match('Chrome') && parseInt(window.navigator.userAgent.match(/Chrome\/(.*) /)[1], 10) >= 26) || | ||
(window.navigator.userAgent.match('Firefox') && parseInt(window.navigator.userAgent.match(/Firefox\/(.*)/)[1], 10) >= 33)); | ||
((prefix === 'webkit' && version >= 26) || | ||
(prefix === 'moz' && version >= 33)) | ||
var AudioContext = window.AudioContext || window.webkitAudioContext; | ||
@@ -26,2 +29,3 @@ var videoEl = document.createElement('video'); | ||
prefix: prefix, | ||
browserVersion: version, | ||
support: !!PC && supportVp8 && !!getUserMedia, | ||
@@ -28,0 +32,0 @@ // new support style |
{ | ||
"name": "webrtcsupport", | ||
"description": "Browser module to detect support for webrtc and extract proper constructors.", | ||
"version": "1.2.6", | ||
"version": "1.3.0", | ||
"author": "Henrik Joreteg <henrik@andyet.net>", | ||
@@ -6,0 +6,0 @@ "browser": "index-browser.js", |
@@ -29,2 +29,3 @@ # webrtcsupport | ||
support: // boolean whether basic WebRTC support exists | ||
browserVersion: // integer, browser version | ||
supportRTCPeerConnection: // boolean whether basic support for RTCPeerConnection exists | ||
@@ -31,0 +32,0 @@ supportVp8: // boolean guess whether VP8 is supported by the browser |
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
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
55
0
6437
8
66