403Webshell
Server IP : 80.87.202.40  /  Your IP : 216.73.216.169
Web Server : Apache
System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64
User : bitrix ( 600)
PHP Version : 8.2.27
Disable Function : NONE
MySQL : OFF |  cURL : ON |  WGET : ON |  Perl : ON |  Python : OFF |  Sudo : ON |  Pkexec : ON
Directory :  /home/bitrix/ext_www/rospirotorg.ru/bitrix/js/im/call/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /home/bitrix/ext_www/rospirotorg.ru/bitrix/js/im/call/video_strategy.min.js
(function(){BX.namespace("BX.Call");if(BX.Call.VideoStrategy){return}var e={AllowAll:"AllowAll",AllowNone:"AllowNone",OnlySpeaker:"OnlySpeaker",CurrentlyTalking:"CurrentlyTalking"};var t=20;BX.Call.VideoStrategy=function(t){this.call=t.call;this.callView=t.callView;this.strategyType=t.strategyType||e.AllowAll;this.onCallUserVoiceStartedHandler=this.onCallUserVoiceStarted.bind(this);this.onCallUserVoiceStoppedHandler=this.onCallUserVoiceStopped.bind(this);this.onCallViewSetCentralUserHandler=this.onCallViewSetCentralUser.bind(this);this.onCallViewLayoutChangeHandler=this.onCallViewLayoutChange.bind(this);this.users={};this.init()};BX.Call.VideoStrategy.prototype.init=function(){if(this.strategyType===BX.Call.VideoStrategy.AllowAll){this.call.allowVideoFrom(BX.Call.UserMnemonic.all)}else if(this.strategyType===BX.Call.VideoStrategy.AllowNone){this.call.allowVideoFrom(BX.Call.UserMnemonic.none)}this.bindEvents()};BX.Call.VideoStrategy.prototype.bindEvents=function(){this.call.addEventListener(BX.Call.Event.onUserVoiceStarted,this.onCallUserVoiceStartedHandler);this.call.addEventListener(BX.Call.Event.onUserVoiceStopped,this.onCallUserVoiceStoppedHandler);this.callView.subscribe(BX.Call.View.Event.onSetCentralUser,this.onCallViewSetCentralUserHandler);this.callView.subscribe(BX.Call.View.Event.onLayoutChange,this.onCallViewLayoutChangeHandler)};BX.Call.VideoStrategy.prototype.removeEvents=function(){if(this.call){this.call.removeEventListener(BX.Call.Event.onUserVoiceStarted,this.onCallUserVoiceStartedHandler);this.call.removeEventListener(BX.Call.Event.onUserVoiceStopped,this.onCallUserVoiceStoppedHandler)}if(this.callView){this.callView.unsubscribe(BX.Call.View.Event.onSetCentralUser,this.onCallViewSetCentralUserHandler);this.callView.unsubscribe(BX.Call.View.Event.onLayoutChange,this.onCallViewLayoutChangeHandler)}};BX.Call.VideoStrategy.prototype.setType=function(e){if(e==this.strategyType){return}this.strategyType=e;this.applyVideoLimit()};BX.Call.VideoStrategy.prototype.applyVideoLimit=function(){if(this.strategyType===e.AllowAll){this.call.allowVideoFrom(BX.Call.UserMnemonic.all)}else if(this.strategyType===e.AllowNone){this.call.allowVideoFrom(BX.Call.UserMnemonic.none)}else if(this.strategyType===e.CurrentlyTalking){var t=this.getActiveUsers();console.log("talking users",t);if(t.length===0){this.call.allowVideoFrom(BX.Call.UserMnemonic.none)}else{this.call.allowVideoFrom(this.getActiveUsers())}}};BX.Call.VideoStrategy.prototype.getActiveUsers=function(){var e=[];for(var t in this.users){var i=this.users[t];if(i.active){e.push(i.id)}}return e};BX.Call.VideoStrategy.prototype.onUserActiveChanged=function(){if(this.strategyType==e.CurrentlyTalking){this.applyVideoLimit()}};BX.Call.VideoStrategy.prototype.onCallUserVoiceStarted=function(e){var t=e.userId;if(!this.users[t]){this.users[t]=new i({id:t,onActiveChanged:this.onUserActiveChanged.bind(this)})}this.users[t].setTalking(true)};BX.Call.VideoStrategy.prototype.onCallUserVoiceStopped=function(e){var t=e.userId;if(!this.users[t]){this.users[t]=new i({id:t,onActiveChanged:this.onUserActiveChanged.bind(this)})}this.users[t].setTalking(false)};BX.Call.VideoStrategy.prototype.onCallViewSetCentralUser=function(t){var i=t.data.userId;if(this.strategyType===e.OnlySpeaker){console.log("requesting video only from "+i);this.call.allowVideoFrom([i])}};BX.Call.VideoStrategy.prototype.onCallViewLayoutChange=function(e){};BX.Call.VideoStrategy.prototype.destroy=function(){this.removeEvents();this.call=null;this.callView=null;for(var e in this.users){if(this.users.hasOwnProperty(e)){this.users[e].destroy()}}this.users={}};var i=function(e){this.id=e.id;this.talking=false;this.sharing=false;this.active=false;this.callbacks={onActiveChanged:BX.type.isFunction(e.onActiveChanged)?e.onActiveChanged:BX.DoNothing};this.turnOffVideoTimeout=null};i.prototype.setTalking=function(e){if(this.talking==e){return}this.talking=e;if(this.talking){this.cancelTurnOffVideo();this.updateActive()}else{this.scheduleTurnOffVideo()}};i.prototype.setSharing=function(e){if(this.sharing==e){return}this.sharing=e;if(this.sharing){this.cancelTurnOffVideo();this.updateActive()}else{this.scheduleTurnOffVideo()}};i.prototype.updateActive=function(){var e=!!(this.sharing||this.talking||this.turnOffVideoTimeout);if(e!=this.active){this.active=e}this.callbacks.onActiveChanged({userId:this.id,active:this.active})};i.prototype.scheduleTurnOffVideo=function(){clearTimeout(this.turnOffVideoTimeout);this.turnOffVideoTimeout=setTimeout(function(){this.turnOffVideoTimeout=null;this.updateActive()}.bind(this),t*1e3)};i.prototype.cancelTurnOffVideo=function(){clearTimeout(this.turnOffVideoTimeout);this.turnOffVideoTimeout=null};i.prototype.destroy=function(){this.callbacks.onActiveChanged=BX.DoNothing;clearTimeout(this.turnOffVideoTimeout)};BX.Call.VideoStrategy.Type=e})();
//# sourceMappingURL=video_strategy.map.js

Youez - 2016 - github.com/yon3zu
LinuXploit