Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
var browser = require('bowser'),
debug = require('debug')('rtcninja:Adapter'),
debugerror = require('debug')('rtcninja:ERROR:Adapter'),
// Internal vars
getUserMedia = null,
RTCPeerConnection = null,
RTCSessionDescription = null,
RTCIceCandidate = null,
MediaStreamTrack = null,
getMediaDevices = null,
attachMediaStream = null,
canRenegotiate = false,
oldSpecRTCOfferOptions = false,
browserVersion = Number(browser.version) || 0,
isDesktop = !!(!browser.mobile && !browser.tablet),
hasWebRTC = false,
virtGlobal, virtNavigator;
debugerror.log = console.warn.bind(console);
// Dirty trick to get this library working in a Node-webkit env with browserified libs
virtGlobal = global.window || global;
// Don't fail in Node
virtNavigator = virtGlobal.navigator || {};
// Constructor.
function Adapter(options) {
// Chrome desktop, Chrome Android, Opera desktop, Opera Android, Android native browser
private static getBrowserVersion() : number {
return Number(bowser.version);
}
config: function() {
_.extend(this.data, {
value: '',
type: '',
placeholder: '',
state: '',
maxlength: undefined,
unit: '',
rules: [],
validating: false,
autofocus: false,
_eltIE9: bowser.msie && bowser.version <= 9
});
this.supr();
var $outer = this.$outer;
if($outer && $outer instanceof Validation) {
$outer.controls.push(this);
this.$on('destroy', function() {
var index = $outer.controls.indexOf(this);
$outer.controls.splice(index, 1);
});
}
},
/**
render () {
const { size, children, ...props } = this.props
const ie11 = bowser.msie && bowser.version > 10
return (
FileUploader.prototype.handleClick = function(){
if (browser.msie && browser.version < 10) {
var self = this;
var params = {
userID:LoginUserManager.user.get('id'),
token:LoginUserManager.user.get('token'),
localID:'',
roomID:LoginUserManager.roomID,
type:CONST.MESSAGE_TYPE_FILE
};
FileUploadDialog.show(UrlGenerator.sendFile(),params,function(){
self.startUploadingFile();
});
const checkBrowserMajorVersion = () => parseInt(bowser.version, 10);
const checkDevicePixelRatio = () => window.devicePixelRatio;