webrtcsupport
Advanced tools
Comparing version 1.2.0 to 1.2.1
{ | ||
"name": "webrtcsupport", | ||
"description": "Browser module to detect support for webrtc and extract proper constructors.", | ||
"version": "1.2.0", | ||
"version": "1.2.1", | ||
"author": "Henrik Joreteg <henrik@andyet.net>", | ||
@@ -6,0 +6,0 @@ "browser": "index-browser.js", |
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var f;"undefined"!=typeof window?f=window:"undefined"!=typeof global?f=global:"undefined"!=typeof self&&(f=self),f.webrtcsupport=e()}}(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(_dereq_,module,exports){ | ||
// created by @HenrikJoreteg | ||
var prefix; | ||
var isChrome = false; | ||
var isFirefox = false; | ||
var ua = window.navigator.userAgent.toLowerCase(); | ||
// basic sniffing | ||
if (ua.indexOf('firefox') !== -1) { | ||
if (window.mozRTCPeerConnection || navigator.mozGetUserMedia) { | ||
prefix = 'moz'; | ||
isFirefox = true; | ||
} else if (ua.indexOf('chrome') !== -1) { | ||
} else if (window.webkitRTCPeerConnection || navigator.webkitGetUserMedia) { | ||
prefix = 'webkit'; | ||
isChrome = true; | ||
} | ||
@@ -21,20 +15,26 @@ | ||
var MediaStream = window.webkitMediaStream || window.MediaStream; | ||
var screenSharing = window.location.protocol === 'https:' && | ||
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)); | ||
var AudioContext = window.webkitAudioContext || window.AudioContext; | ||
var supportVp8 = document.createElement('video').canPlayType('video/webm; codecs="vp8", vorbis') === "probably"; | ||
var getUserMedia = navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.msGetUserMedia || navigator.mozGetUserMedia; | ||
// export support flags and constructors.prototype && PC | ||
module.exports = { | ||
support: !!PC, | ||
dataChannel: isChrome || isFirefox || (PC && PC.prototype && PC.prototype.createDataChannel), | ||
support: !!PC && supportVp8 && !!getUserMedia, | ||
supportRTCPeerConnection: !!PC, | ||
supportVp8: supportVp8, | ||
supportGetUserMedia: !!getUserMedia, | ||
supportDataChannel: isChrome || isFirefox || (PC && PC.prototype && PC.prototype.createDataChannel), | ||
supportWebAudio: !!(AudioContext && AudioContext.prototype.createMediaStreamSource), | ||
supportMediaStream: !!(MediaStream && MediaStream.prototype.removeTrack), | ||
supportScreenSharing: !!screenSharing, | ||
prefix: prefix, | ||
webAudio: !!(AudioContext && AudioContext.prototype.createMediaStreamSource), | ||
mediaStream: !!(MediaStream && MediaStream.prototype.removeTrack), | ||
screenSharing: !!screenSharing, | ||
AudioContext: AudioContext, | ||
PeerConnection: PC, | ||
SessionDescription: SessionDescription, | ||
IceCandidate: IceCandidate | ||
IceCandidate: IceCandidate, | ||
MediaStream: MediaStream, | ||
getUserMedia: getUserMedia | ||
}; | ||
@@ -41,0 +41,0 @@ |
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
8877
98