Your IP : 3.135.228.15


Current Path : /home/bitrix/ext_www/klimatlend.ua/bitrix/js/im/
Upload File :
Current File : /home/bitrix/ext_www/klimatlend.ua/bitrix/js/im/call.min.js

(function(){var e=null;var t=null;var i=function(e){this.mediaState={video:null,audio:null};this.webrtcState=null;this.callbacks={onAttached:BX.type.isFunction(e.onAttached)?e.onAttached:null,onDetached:BX.type.isFunction(e.onDetached)?e.onDetached:null,onRoomJoined:BX.type.isFunction(e.onRoomJoined)?e.onRoomJoined:null,onRoomLeft:BX.type.isFunction(e.onRoomLeft)?e.onRoomLeft:null,onError:BX.type.isFunction(e.onError)?e.onError:null,onRemoteFeed:BX.type.isFunction(e.onRemoteFeed)?e.onRemoteFeed:null,onDestroyed:BX.type.isFunction(e.onDestroyed)?e.onDestroyed:null,onPublisherLeft:BX.type.isFunction(e.onPublisherLeft)?e.onPublisherLeft:null,onWebrtcState:BX.type.isFunction(e.onWebrtcState)?e.onWebrtcState:null};this.userId=e.userId;this.pluginHandle=null;this.localStream=e.stream;this.init()};i.prototype.init=function(){this.attach()};i.prototype.attach=function(){var t=this;e.attach({plugin:"janus.plugin.videoroom",success:this.onAttached.bind(this),error:this.onError.bind(this),consentDialog:function(){console.log("consentDialog??")},webrtcState:function(e){t.webrtcState=e},mediaState:function(e,i){if(t.mediaState.hasOwnProperty(e)){t.mediaState[e]=i}},onmessage:this.onMessage.bind(this),onlocalstream:function(){console.log("onlocalstream")},onremotestream:function(){console.log("onremotestream")},oncleanup:function(){console.log("oncleanup")},ondetached:function(){console.log("Publisher detached")}})};i.prototype.onAttached=function(e){this.pluginHandle=e;console.log("Plugin attached! ("+e.getPlugin()+", id="+e.getId()+")");console.log("  -- This is a publisher/manager");this.joinRoom()};i.prototype.onError=function(e){if(BX.type.isFunction(this.callbacks.onError)){this.callbacks.onError({target:this,errorCode:0,error:e})}};i.prototype.onMessage=function(e,t){console.log("Received message:",e);var i=e["videoroom"];if(i!=undefined&&i!=null){if(i==="joined"){myid=e["id"];console.log("Successfully joined room "+e["room"]+" with ID "+myid);if(this.localStream){this.publishStream()}if(e["publishers"]!==undefined&&e["publishers"]!==null){if(BX.type.isFunction(this.callbacks.onRemoteFeed))this.callbacks.onRemoteFeed(e["publishers"])}}else if(i==="destroyed"){console.log("The room has been destroyed!");if(BX.type.isFunction(this.callbacks.onDestroyed)){this.callbacks.onDestroyed()}}else if(i==="event"){if(e["publishers"]!==undefined&&e["publishers"]!==null){if(BX.type.isFunction(this.callbacks.onRemoteFeed)){this.callbacks.onRemoteFeed(e["publishers"])}}else if(e["leaving"]!==undefined&&e["leaving"]!==null){if(BX.type.isFunction(this.callbacks.onPublisherLeft)){this.callbacks.onPublisherLeft(e["leaving"])}}else if(e["unpublished"]!==undefined&&e["unpublished"]!==null){var s=e["unpublished"];Janus.log("Publisher left: "+s);if(s==="ok"){this.pluginHandle.hangup();return}else{if(BX.type.isFunction(this.callbacks.onPublisherLeft)){this.callbacks.onPublisherLeft(e["unpublished"])}}}else if(e["error"]!==undefined&&e["error"]!==null){if(BX.type.isFunction(this.callbacks.onError)){this.callbacks.onError({target:this,errorCode:e["error_code"],error:e["error"]})}}}}if(t!==undefined&&t!==null){Janus.debug("Handling SDP as well...");Janus.debug(t);this.pluginHandle.handleRemoteJsep({jsep:t})}};i.prototype.joinRoom=function(){var e=this;return new Promise(function(i,s){var n={request:"join",room:t,ptype:"publisher",display:"user"+e.userId};e.pluginHandle.send({message:n,success:function(e){i(e)},error:function(e){s(e)}})})};i.prototype.publishStream=function(){var e=this;this.pluginHandle.createOffer({media:{audioRecv:false,videoRecv:false,audioSend:true,videoSend:true},stream:e.localStream,success:function(t){Janus.debug("Got publisher SDP!");Janus.debug(t);var i={request:"configure",audio:true,video:true};e.pluginHandle.send({message:i,jsep:t})},error:function(e){Janus.error("WebRTC error:",e)}})};i.prototype.unpublishStream=function(){var e={request:"unpublish"};this.pluginHandle.send({message:e})};i.prototype.changeStream=function(e){var t=this;return new Promise(function(i,s){t.pluginHandle.hangup();setTimeout(function(){t.localStream=e;t.publishStream();return i()},1e3)})};i.prototype.dispose=function(){if(this.pluginHandle){this.pluginHandle.hangup();this.pluginHandle.detach()}this.pluginHandle=null;this.localStream=null};Receiver=function(e){this.feedId=e.feedId;this.userId=e.userId;this.webrtcState=null;this.pluginHandle=null;this.stream=null;this.callbacks={onRemoteStream:BX.type.isFunction(e.onRemoteStream)?e.onRemoteStream:null};this.init()};Receiver.prototype.init=function(){this.attach()};Receiver.prototype.attach=function(){var t=this;e.attach({plugin:"janus.plugin.videoroom",success:this.onAttached.bind(this),error:this.onError.bind(this),webrtcState:function(e){t.webrtcState=e},onmessage:this.onMessage.bind(this),onlocalstream:function(e){},onremotestream:this.onRemoteStream.bind(this),oncleanup:function(){console.log("oncleanup")}})};Receiver.prototype.onAttached=function(e){this.pluginHandle=e;this.joinRoom()};Receiver.prototype.onMessage=function(e,i){var s=this;Janus.debug(" ::: Got a message (listener) :::");Janus.debug(JSON.stringify(e));var n=e["videoroom"];Janus.debug("Event: "+n);if(n!=undefined&&n!=null){if(n==="attached"){console.log("Successfully attached to feed ",e)}else if(e["error"]!==undefined&&e["error"]!==null){console.log("Receiver error: ",e["error"])}else{console.log("Empty message from media gateway")}}if(i!==undefined&&i!==null){Janus.debug("Handling SDP as well...");Janus.debug(i);this.pluginHandle.createAnswer({jsep:i,media:{audioRecv:true,videoRecv:true,audioSend:false,videoSend:false},success:function(e){Janus.debug("Got SDP!");Janus.debug(e);var i={request:"start",room:t};s.pluginHandle.send({message:i,jsep:e})},error:function(e){console.log("WebRTC error:",e)}})}};Receiver.prototype.onRemoteStream=function(e){this.stream=e;console.log("remote stream received");var t={target:this,stream:e};if(BX.type.isFunction(this.callbacks.onRemoteStream))this.callbacks.onRemoteStream(t)};Receiver.prototype.onError=function(e){console.log("Receiver error: ",e)};Receiver.prototype.joinRoom=function(){console.log("feed: ",this.feedId);var e={request:"join",room:t,ptype:"listener",feed:this.feedId};this.pluginHandle.send({message:e})};Receiver.prototype.dispose=function(){this.stream=null;if(this.pluginHandle){this.pluginHandle.hangup();this.pluginHandle.detach()}};var s=function(e){this.server=e.server;this.apiSecret=e.apiSecret;t=e.roomId;this.elements={root:BX.type.isDomNode(e.element)?e.element:null,errors:null,main:null,mainPlaceholder:null,self:{main:null,video:null},receivers:{},buttons:{mic:{button:null,icon:null},camera:{button:null,icon:null},connect:{button:null,icon:null},log:{button:null,icon:null},signout:{button:null,icon:null}},hardware:{main:null,mic:null,camera:null,resolution:null},log:null};this.chatId=e.chatId;this.userCount=e.userCount;this.userId=e.userId;this.userDetails=e.userDetails;this.publisher=null;this.receivers=[];this.localStream=null;this.hardware=this.getDefaultHardware();this.state={mic:true,camera:true,connect:true,selectMic:true,selectCamera:true,log:false};this.resolutions={QVGA:{description:"QVGA (320x240)",width:{max:320,min:320},height:{max:240,min:240}},VGA:{description:"VGA (640x480)",width:{max:640,min:320,ideal:640},height:{max:480,min:240,ideal:480}},HD:{description:"HD (1280x720)",width:{max:1280,min:320,ideal:1280},height:{max:720,min:240,ideal:720}}};this.logText="";this.init()};s.prototype.init=function(){this.render();this.bindEvents();this.elements.self.video.volume=0;Janus.init({debug:false,callback:this.onJanusInited.bind(this)})};s.prototype.bindEvents=function(){this.elements.hardware.mic.addEventListener("change",this.onChangeMicrophone.bind(this));this.elements.hardware.camera.addEventListener("change",this.onChangeCamera.bind(this));this.elements.hardware.resolution.addEventListener("change",this.onChangeResolution.bind(this));this.elements.buttons.mic.button.addEventListener("click",this.onMicClick.bind(this));this.elements.buttons.camera.button.addEventListener("click",this.onCameraClick.bind(this));this.elements.buttons.log.button.addEventListener("click",this.onLogClick.bind(this));this.elements.buttons.signout.button.addEventListener("click",this.onSignOutClick.bind(this))};s.prototype.getDefaultHardware=function(){return{mic:localStorage.getItem("im-call-prototype-hardware-mic"),camera:localStorage.getItem("im-call-prototype-hardware-camera"),resolution:localStorage.getItem("im-call-prototype-hardware-resolution")||"HD"}};s.prototype.showLocalVideo=function(){BX.removeClass(this.elements.self.main,"im-call-hidden")};s.prototype.showHardwareSettings=function(){BX.removeClass(this.elements.hardware.main,"im-call-hidden")};s.prototype.onJanusInited=function(){this.log(BX.message("IM_CALL_CONNECTING"));e=new Janus({server:this.server,apisecret:this.apiSecret,success:this.onJanusConnected.bind(this),error:this.onJanusError.bind(this),destroyed:function(){console.log("something went terribly wrong")}})};s.prototype.onJanusConnected=function(){this.log(BX.message("IM_CALL_CONNECTED"));var e=this;this.createLocalStream().then(function(){r(e.elements.self.video,e.localStream);return e.fillHardware()},function(t){e.showError(BX.message("IM_CALL_ERROR_HARDWARE")+" "+t);return e.fillHardware()}).then(function(){e.showHardwareSettings();if(e.localStream){e.showLocalVideo();e.log(BX.message("IM_CALL_PUBLISHING"))}e.publisher=new i({userId:e.userId,stream:e.localStream,onRemoteFeed:e.onRemoteFeed.bind(e),onAttached:e.onPublisherAttached.bind(e),onDetached:function(){e.log(BX.message("IM_CALL_PUBLISHING_STOPPED"))},onPublisherLeft:e.onPublisherLeft.bind(e),onError:function(t){e.showError(BX.message("IM_CALL_PUBLISHING_ERROR")+": "+t.error)},onWebrtcState:function(){}})})};s.prototype.onPublisherAttached=function(){};s.prototype.onJanusError=function(e){this.showError(BX.message("IM_CALL_ERROR_CONNECTION")+" "+e)};s.prototype.createLocalStream=function(){var e=this;this.log(BX.message("IM_CALL_HARDWARE_REQUEST"));return new Promise(function(t,i){navigator.mediaDevices.getUserMedia(e.getMediaConstraints()).then(function(i){e.log(BX.message("IM_CALL_ACCESS_GRANTED"));e.localStream=i;return t(i)},function(t){e.log(BX.message("IM_CALL_ERROR_HARDWARE")+" "+t);i(t)})})};s.prototype.fillHardware=function(){var e=this;var t=function(){if(!e.localStream)return"";var t=e.localStream.getVideoTracks();if(t.length>0&&t[0].label)return t[0].label;else return""}();var i=function(){if(!e.localStream)return"";var t=e.localStream.getAudioTracks();if(t.length>0&&t[0].label)return t[0].label;else return""}();return new Promise(function(s,n){var r;e.elements.hardware.camera.options.length=0;e.elements.hardware.mic.options.length=0;e.elements.hardware.resolution.options.length=0;for(resolution in e.resolutions){r=BX.create("option",{text:e.resolutions[resolution].description,attrs:{value:resolution}});if(resolution===e.hardware.resolution){r.selected=true}e.elements.hardware.resolution.options.add(r)}navigator.mediaDevices.enumerateDevices().then(function(n){n.forEach(function(s){var n;if(s.label=="")return;if(s.kind==="audioinput"||s.deviceId===e.hardware.mic){n=BX.create("option",{text:s.label,attrs:{value:s.deviceId}});if(s.label===i){n.selected=true}e.elements.hardware.mic.options.add(n)}else if(s.kind==="videoinput"){n=BX.create("option",{text:s.label,attrs:{value:s.deviceId}});if(s.label===t||s.deviceId==e.hardware.camera){n.selected=true}e.elements.hardware.camera.options.add(n)}});return s()}).catch(function(e){return n(e)})})};s.prototype.getMediaConstraints=function(){var e={audio:{},video:false};if(this.hardware.mic){e.audio.deviceId={exact:this.hardware.mic}}if(this.state.camera){e.video={};if(this.hardware.camera){e.video.deviceId={exact:this.hardware.camera}}if(this.resolutions[this.hardware.resolution]){e.video.width=this.resolutions[this.hardware.resolution].width;e.video.height=this.resolutions[this.hardware.resolution].height}}return e};s.prototype.onRemoteFeed=function(e){for(var t in e){if(e.hasOwnProperty(t)){this.attachRemoteFeed(e[t])}}};s.prototype.onPublisherLeft=function(e){var t=this;console.log("onPublisherLeft: ",e);this.receivers.forEach(function(i,s){if(i.feedId==e){t.log(t.getUserName(i.userId)+" "+BX.message("IM_CALL_USER_DISCONNECTED"));i.dispose();t.receivers.splice(s,1)}});if(t.elements.receivers[e]){BX.cleanNode(t.elements.receivers[e].main,true);delete t.elements.receivers[e];if(this.receivers.length==0)BX.removeClass(this.elements.mainPlaceholder,"im-call-hidden")}};s.prototype.onRemoteStream=function(e){if(e.target){this.renderReceiver(e.target)}};s.prototype.onChangeMicrophone=function(e){var t=e.target.value;localStorage.setItem("im-call-prototype-hardware-mic",t);this.hardware.mic=t;this.reapplyConstraints()};s.prototype.onChangeCamera=function(e){var t=e.target.value;this.hardware.camera=t;localStorage.setItem("im-call-prototype-hardware-camera",t);this.reapplyConstraints()};s.prototype.onChangeResolution=function(e){var t=e.target.value;if(!this.resolutions[t])return;this.hardware.resolution=t;localStorage.setItem("im-call-prototype-hardware-resolution",t);this.reapplyConstraints()};s.prototype.onMicClick=function(e){this.setMicState(!this.state.mic)};s.prototype.onCameraClick=function(e){this.setCameraState(!this.state.camera)};s.prototype.onConnectClick=function(e){};s.prototype.onLogClick=function(e){this.setLogState(!this.state.log)};s.prototype.onSignOutClick=function(e){this.dispose()};s.prototype.setMicState=function(e){if(!this.localStream||!this.publisher.webrtcState)return;e=e==true;this.state.mic=e;if(e){this.publisher.pluginHandle.unmuteAudio()}else{this.publisher.pluginHandle.muteAudio()}this.renderButtons()};s.prototype.setCameraState=function(e){e=e==true;this.state.camera=e;if(this.localStream){this.reapplyConstraints()}this.renderButtons()};s.prototype.setLogState=function(e){e=e==true;this.state.log=e;if(this.state.log)BX.removeClass(this.elements.log,"im-call-hidden");else BX.addClass(this.elements.log,"im-call-hidden")};s.prototype.reapplyConstraints=function(){var e=this;this.elements.self.video.src=null;this.elements.self.video.pause();BX.showWait(this.elements.self.main);e.state.selectCamera=false;e.state.selectMic=false;e.renderButtons();BX.webrtc.stopMediaStream(this.localStream);this.localStream=null;this.publisher.unpublishStream();this.createLocalStream().then(function(){e.publisher.changeStream(e.localStream).then(function(){BX.closeWait(e.elements.self.main);e.state.selectCamera=e.state.camera;e.state.selectMic=true;e.renderButtons();r(e.elements.self.video,e.localStream)})}).catch(function(t){e.showError("IM_CALL_ERROR_HARDWARE"+" "+t);BX.closeWait(e.elements.self.main);e.state.selectCamera=e.state.camera;e.state.selectMic=true;e.renderButtons()})};s.prototype.attachRemoteFeed=function(e){var t=e.id;var i=e.display||"";var s;if(i.search("user")===0)s=i.substring(4);this.log(this.getUserName(s)+" "+BX.message("IM_CALL_USER_CONNECTED"));var n=new Receiver({feedId:t,userId:s,onRemoteStream:this.onRemoteStream.bind(this)});var r=this.receivers.some(function(e){return e.feedId==t});if(!r){this.receivers.push(n)}this.renderReceiver(n)};s.prototype.renderReceiver=function(e){if(!this.elements.receivers[e.feedId]){this.elements.receivers[e.feedId]=this.createReceiverNode(e);this.elements.main.appendChild(this.elements.receivers[e.feedId].main);BX.addClass(this.elements.mainPlaceholder,"im-call-hidden")}this.elements.receivers[e.feedId].caption.innerText=this.getUserName(e.userId);this.elements.receivers[e.feedId].resolution.innerText="";this.elements.receivers[e.feedId].bitrate.innerText="";if(e.stream){r(this.elements.receivers[e.feedId].streamVideo,e.stream);if(e.stream.getVideoTracks().length>0){BX.addClass(this.elements.receivers[e.feedId].avatar,"im-call-hidden");BX.removeClass(this.elements.receivers[e.feedId].stream,"im-call-hidden")}else{BX.removeClass(this.elements.receivers[e.feedId].avatar,"im-call-hidden");BX.addClass(this.elements.receivers[e.feedId].stream,"im-call-hidden")}}else{this.elements.receivers[e.feedId].avatarImg.src=this.getUserAvatar(e.userId,true);this.elements.receivers[e.feedId].streamVideo.src="";BX.removeClass(this.elements.receivers[e.feedId].avatar,"im-call-hidden");BX.addClass(this.elements.receivers[e.feedId].stream,"im-call-hidden")}};s.prototype.renderButtons=function(){if(this.state.mic)BX.removeClass(this.elements.buttons.mic.icon,"im-call-button-disabled");else BX.addClass(this.elements.buttons.mic.icon,"im-call-button-disabled");if(this.state.camera){BX.removeClass(this.elements.buttons.camera.icon,"im-call-button-disabled");BX.removeClass(this.elements.self.main,"im-call-hidden");this.elements.hardware.camera.disabled=false}else{BX.addClass(this.elements.buttons.camera.icon,"im-call-button-disabled");BX.addClass(this.elements.self.main,"im-call-hidden");this.elements.hardware.camera.disabled=true}if(this.state.connect)BX.removeClass(this.elements.buttons.connect.icon,"im-call-button-disabled");else BX.addClass(this.elements.buttons.connect.icon,"im-call-button-disabled")};s.prototype.showBitrate=function(e,t){};s.prototype.showResolution=function(e,t){};s.prototype.createReceiverNode=function(e){var t,i,s,n,r,o,a,l;var c=BX.create("div",{props:{className:"im-video-other"},children:[t=BX.create("div",{props:{className:"im-video-other-video im-call-hidden"},children:[i=BX.create("video"),l=BX.create("div",{props:{className:"im-video-other-button im-video-other-button-fullscreen"},children:[BX.create("div",{props:{className:"im-video-other-button-icon"},children:[BX.create("i",{props:{className:"fa fa-arrows-alt"},attrs:{"aria-hidden":true}})]})],events:{click:function(t){this.toggleFullScreen(e)}.bind(this)}})]}),o=BX.create("div",{props:{className:"im-video-other-avatar"},children:[a=BX.create("img",{props:{className:"im-video-other-avatar-img"}})]}),s=BX.create("div",{props:{className:"im-video-other-caption"}}),n=BX.create("div",{props:{className:"im-video-other-resolution"}}),r=BX.create("div",{props:{className:"im-video-other-bitrate"}})]});var d={main:c,stream:t,streamVideo:i,buttons:{fullScreen:l},avatar:o,avatarImg:a,caption:s,resolution:n,bitrate:r};return d};s.prototype.toggleFullScreen=function(e){if(!this.elements.receivers[e.feedId])return;var t=document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement;if(t){if(document.cancelFullscreen)document.cancelFullscreen();else if(document.mozCancelFullScreen)document.mozCancelFullScreen();else if(document.webkitCancelFullScreen)document.webkitCancelFullScreen();return}var i=this.elements.receivers[e.feedId].stream;if(i.requestFullScreen)i.requestFullScreen();else if(i.mozRequestFullScreen)i.mozRequestFullScreen();else if(i.webkitRequestFullScreen)i.webkitRequestFullScreen();else console.log("fullscreen mode is not supported")};s.prototype.showError=function(e){this.log(e);var t=BX.create("div",{props:{className:"im-call-errors-error"},children:[BX.create("div",{props:{className:"im-call-errors-error-close"},children:[BX.create("i",{props:{className:"fa fa-times"}})],events:{click:function(){BX.cleanNode(t,true)}}}),BX.create("div",{props:{className:"im-call-errors-error-text"},text:e})]});this.elements.errors.appendChild(t)};s.prototype.getUserName=function(e){e=parseInt(e);var t="";if(this.userDetails[e]){t=this.userDetails[e].name}return t};s.prototype.getUserAvatar=function(e,t){t=t==true;e=parseInt(e);var i="";if(t){if(this.userDetails.hrphoto&&this.userDetails.hrphoto[e]){i=this.userDetails.hrphoto[e]}}else{if(this.userDetails[e]){i=this.userDetails[e].avatar}}return i};s.prototype.render=function(){if(!this.elements.root){this.elements.root=BX.create("div",{props:{className:"im-call"}});document.body.appendChild(this.elements.root)}else{BX.addClass(this.elements.root,"im-call")}BX.adjust(this.elements.root,{children:[this.elements.errors=BX.create("div",{props:{className:"im-call-errors"}}),this.elements.main=BX.create("div",{props:{className:"im-call-main"},children:[this.elements.mainPlaceholder=BX.create("div",{props:{className:"im-call-main-placeholder"},text:BX.message("IM_CALL_WAITING_CONNECT")})]}),BX.create("div",{props:{className:"im-call-buttons"},children:[this.elements.buttons.mic.button=BX.create("div",{props:{className:"im-call-button im-call-button-mic"},children:[this.elements.buttons.mic.icon=BX.create("div",{props:{className:"im-call-button-icon"},html:'<i class="fa fa-microphone" aria-hidden="true"></i>'})]}),this.elements.buttons.camera.button=BX.create("div",{props:{className:"im-call-button im-call-button-camera"},children:[this.elements.buttons.camera.icon=BX.create("div",{props:{className:"im-call-button-icon"},html:'<i class="fa fa-video-camera" aria-hidden="true"></i>'})]}),this.elements.buttons.log.button=BX.create("div",{props:{className:"im-call-button im-call-button-log "},children:[this.elements.buttons.log.icon=BX.create("div",{props:{className:"im-call-button-icon"},html:'<i class="fa fa-list" aria-hidden="true"></i>'})]}),this.elements.buttons.signout.button=BX.create("div",{props:{className:"im-call-button im-call-button-signout im-call-button-last"},children:[this.elements.buttons.signout.icon=BX.create("div",{props:{className:"im-call-button-icon"},html:'<i class="fa fa-sign-out" aria-hidden="true"></i>'})]}),this.elements.hardware.main=BX.create("div",{props:{className:"im-call-hardware im-call-hidden"},children:[BX.create("div",{props:{className:"im-call-hardware-mic"},children:[BX.create("label",{attrs:{"for":"im-call-hardware-select-mic"},text:BX.message("IM_CALL_HARDWARE_MIC")+":"}),this.elements.hardware.mic=BX.create("select",{attrs:{id:"im-call-hardware-select-mic"}})]}),BX.create("div",{props:{className:"im-call-hardware-camera"},children:[BX.create("label",{attrs:{"for":"im-call-hardware-select-camera"},text:BX.message("IM_CALL_HARDWARE_CAMERA")+":"}),this.elements.hardware.camera=BX.create("select",{attrs:{id:"im-call-hardware-select-camera"}})]}),BX.create("div",{props:{className:"im-call-hardware-resolution"},children:[BX.create("label",{attrs:{"for":"im-call-hardware-select-resolution"},text:BX.message("IM_CALL_HARDWARE_RESOLUTION")+":"}),this.elements.hardware.resolution=BX.create("select",{attrs:{id:"im-call-hardware-select-resolution"}})]})]}),this.elements.self.main=BX.create("div",{props:{className:"im-call-video-self im-call-hidden"},children:[BX.create("div",{props:{className:"im-call-video-self-video"},children:[this.elements.self.video=BX.create("video")]})]})]}),this.elements.log=BX.create("pre",{props:{className:"im-call-log im-call-hidden"}})]});return this.elements.root};s.prototype.dispose=function(){var e=this;for(feedId in this.elements.receivers){this.elements.receivers[feedId].streamVideo.pause();this.elements.receivers[feedId].streamVideo.src=""}this.receivers.forEach(function(e){e.dispose()});this.receivers=[];if(this.publisher){this.publisher.dispose()}if(this.localStream){BX.webrtc.stopMediaStream(this.localStream)}this.localStream=null;BX.remove(this.elements.root,true)};s.prototype.log=function(e){var t=new Date;var i=n(t.getHours(),2,"0")+":"+n(t.getMinutes(),2,"0")+":"+n(t.getSeconds(),2,"0");var s=i+": "+e+"\n";this.logText=this.logText+s;this.elements.log.innerText=this.logText};function n(e,t,i){if(!BX.type.isString(e))e=e.toString();if(e.length<t)return i.repeat(t-e.length)+e;else return e}function r(e,t){e.src=URL.createObjectURL(t);e.load();e.play()}window.CallView=s})();
//# sourceMappingURL=call.map.js