File manager - Edit - /home/web/vm-3fadc827.na4u.ru/www/bitrix/modules/im/install/js/im/call/hardware.min.js
Back
(function(){var e={defaultMicrophone:"bx-im-settings-default-microphone",defaultCamera:"bx-im-settings-default-camera",defaultSpeaker:"bx-im-settings-default-speaker",enableMicAutoParameters:"bx-im-settings-enable-mic-auto-parameters",preferHd:"bx-im-settings-camera-prefer-hd",enableMirroring:"bx-im-settings-camera-enable-mirroring"};var t={initialized:"initialized",deviceChanged:"deviceChange",onChangeMirroringVideo:"onChangeMirroringVideo"};var i=function(){this.initialized=false;this._currentDeviceList=[];this.updating=false;Object.defineProperty(this,"cameraList",{get:this._getDeviceMap.bind(this,"videoinput")});Object.defineProperty(this,"microphoneList",{get:function(){return this._getDeviceMap("audioinput")}});Object.defineProperty(this,"audioOutputList",{get:function(){return this._getDeviceMap("audiooutput")}});Object.defineProperty(this,"defaultMicrophone",{get:function(){var t=localStorage?localStorage.getItem(e.defaultMicrophone):"";return this.microphoneList[t]?t:""},set:function(t){if(localStorage){localStorage.setItem(e.defaultMicrophone,t)}}});Object.defineProperty(this,"defaultCamera",{get:function(){var t=localStorage?localStorage.getItem(e.defaultCamera):"";return this.cameraList[t]?t:""},set:function(t){if(localStorage){localStorage.setItem(e.defaultCamera,t)}}});Object.defineProperty(this,"defaultSpeaker",{get:function(){var t=localStorage?localStorage.getItem(e.defaultSpeaker):"";return this.audioOutputList[t]?t:""},set:function(t){if(localStorage){localStorage.setItem(e.defaultSpeaker,t)}}});Object.defineProperty(this,"enableMicAutoParameters",{get:function(){return localStorage?localStorage.getItem(e.enableMicAutoParameters)!=="N":true},set:function(t){if(localStorage){localStorage.setItem(e.enableMicAutoParameters,t?"Y":"N")}}});Object.defineProperty(this,"preferHdQuality",{get:function(){return localStorage?localStorage.getItem(e.preferHd)!=="N":true},set:function(t){if(localStorage){localStorage.setItem(e.preferHd,t?"Y":"N")}}});Object.defineProperty(this,"enableMirroring",{get:function(){return localStorage?localStorage.getItem(e.enableMirroring)!=="N":true},set:function(i){if(this.enableMirroring!==i){this.eventEmitter.emit(t.onChangeMirroringVideo,{enableMirroring:i});if(BX.desktop){BX.desktop.onCustomEvent(t.onChangeMirroringVideo,[i])}if(localStorage){localStorage.setItem(e.enableMirroring,i?"Y":"N")}}}});this.eventEmitter=new BX.Event.EventEmitter(this,"HardwareManager")};i.prototype={init:function(){return new Promise(function(e,i){if(this.initialized){return e()}this.enumerateDevices().then(function(i){this._currentDeviceList=this.filterDeviceList(i);navigator.mediaDevices.addEventListener("devicechange",BX.debounce(this.onNavigatorDeviceChanged.bind(this),500));this.initialized=true;this.eventEmitter.emit(t.initialized,{});e()}.bind(this)).catch(i)}.bind(this))},enumerateDevices:function(){return new Promise(function(e,t){if(!navigator.mediaDevices||!navigator.mediaDevices.enumerateDevices){return t("NO_WEBRTC")}navigator.mediaDevices.enumerateDevices().then(function(t){e(t)}.bind(this))}.bind(this))},hasCamera:function(){if(!this.initialized){throw new Error("HardwareManager is not initialized yet")}return Object.keys(this.cameraList).length>0},getMicrophoneList:function(){if(!this.initialized){throw new Error("HardwareManager is not initialized yet")}return Object.values(this._currentDeviceList).filter((function(e){return e.kind=="audioinput"}))},getCameraList:function(){if(!this.initialized){throw new Error("HardwareManager is not initialized yet")}return Object.values(this._currentDeviceList).filter((function(e){return e.kind=="videoinput"}))},getSpeakerList:function(){if(!this.initialized){throw new Error("HardwareManager is not initialized yet")}return Object.values(this._currentDeviceList).filter((function(e){return e.kind=="audiooutput"}))},canSelectSpeaker:function(){return"setSinkId"in HTMLMediaElement.prototype},updateDeviceList:function(e){if(this.updating){return}this.updating=true;var i=this._currentDeviceList;var r=[];var n=this._currentDeviceList.every((function(e){return e.deviceId==""&&e.label==""}));navigator.mediaDevices.enumerateDevices().then(function(e){e=this.filterDeviceList(e);e.forEach((function(e){var t=i.findIndex((function(t){return t.kind==e.kind&&t.deviceId==e.deviceId}));if(t!=-1){i.splice(t,1)}else{r.push(e)}}),this);if(!n){this.eventEmitter.emit(t.deviceChanged,{added:r,removed:i})}this._currentDeviceList=e;this.updating=false}.bind(this))},filterDeviceList:function(e){return e.filter((function(e){if(e.kind=="audioinput"&&e.deviceId=="default"){return false}if(e.kind=="audioinput"&&e.deviceId=="communications"){return false}if(e.kind=="audiooutput"&&e.deviceId=="default"){return false}return true}))},onNavigatorDeviceChanged:function(e){if(!this.initialized){return}this.updateDeviceList()},subscribe:function(e,t){return this.eventEmitter.subscribe(e,t)},unsubscribe:function(e,t){return this.eventEmitter.unsubscribe(e,t)},_getDeviceMap:function(e){var t={};if(!this.initialized){throw new Error("HardwareManager is not initialized yet")}for(var i=0;i<this._currentDeviceList.length;i++){if(this._currentDeviceList[i].kind==e){t[this._currentDeviceList[i].deviceId]=this._currentDeviceList[i].label}}return t}};var r=function(){};r.prototype.isAvailable=function(){if(BX.getClass("BX.desktop")){return BX.desktop.getApiVersion()>=52}else if(BX.getClass("BX.Messenger.Lib.Utils.platform")){return BX.Messenger.Lib.Utils.platform.getDesktopVersion()>=52}return false};r.prototype.open=function(){if(!this.isAvailable()){if(window.BX.Helper){window.BX.Helper.show("redirect=detail&code=12398124")}return false}var e='<div id="bx-desktop-loader" class="bx-desktop-loader-wrap">'+'<div class="bx-desktop-loader">'+'<svg class="bx-desktop-loader-circular" viewBox="25 25 50 50">'+'<circle class="bx-desktop-loader-path" cx="50" cy="50" r="20" fill="none" stroke-miterlimit="10"/>'+"</svg>"+"</div>"+"</div>"+'<div id="placeholder"></div>';var t='BX.Runtime.loadExtension("im.component.settings.call-background").then(function(exports) {'+"BX.Vue.create({"+'el: document.getElementById("placeholder"),'+"template: '<bx-im-component-settings-call-background :isDesktop=\"true\"/>',"+"});"+"});";(opener||top).BX.desktop.createWindow("callBackground",BX.delegate((function(i){i.SetProperty("title",BX.message("BXD_CALL_BG_TITLE"));i.SetProperty("clientSize",{Width:970,Height:660});i.SetProperty("minClientSize",{Width:970,Height:660});i.SetProperty("backgroundColor","#2B3038");i.ExecuteCommand("html.load",(opener||top).BXIM.desktop.getHtmlPage(e,t,false))}),this));return true};BX.Call.Hardware=new i;BX.Call.Hardware.Events=t;BX.Call.Hardware.BackgroundDialog=new r})(); //# sourceMappingURL=hardware.map.js
| ver. 1.4 |
Github
|
.
| PHP 7.4.33 | Generation time: 0.26 |
proxy
|
phpinfo
|
Settings