mirror of https://github.com/OpenVidu/openvidu.git
1 line
916 KiB
JavaScript
1 line
916 KiB
JavaScript
![]() |
(window.webpackJsonp=window.webpackJsonp||[]).push([[1],{"+leM":function(e,t,n){"use strict";t.__esModule=!0;var r=n("M42G"),i=n("iZBl"),o=n("keth"),s=n("8HiN"),a=n("p571"),u=n("7W0T"),l=n("OCCK"),c=n("dvth"),d=n("8v+A"),p=n("kPIN");p.isIonicIos=("iPhone"===p.product||"iPad"===p.product)&&-1===p.ua.indexOf("Safari"),t.OpenVidu=function(){function e(){var e=this;this.publishers=[],this.secret="",this.recorder=!1,this.advancedConfiguration={},this.webrtcStatsInterval=0,console.info("'OpenVidu' initialized"),"iOS"!==p.os.family&&"Android"!==p.os.family||window.addEventListener("orientationchange",function(){e.publishers.forEach(function(t){if(t.stream&&t.stream.hasVideo&&t.stream.streamManager.videos[0])var n=0,r=t.stream.videoDimensions.width,i=t.stream.videoDimensions.height,o=setInterval(function(){new Promise(function(e,n){if(p.isIonicIos)e({newWidth:t.stream.streamManager.videos[0].video.videoWidth,newHeight:t.stream.streamManager.videos[0].video.videoHeight});else{var r=t.stream.getMediaStream().getVideoTracks()[0].getSettings();e({newWidth:-1!==p.name.toLowerCase().indexOf("firefox")?r.width:t.videoReference.videoWidth,newHeight:-1!==p.name.toLowerCase().indexOf("firefox")?r.height:t.videoReference.videoHeight})}}).then(function(e){a(r,i,e.newWidth,e.newHeight)})},75),a=function(r,i,a,u){++n>10&&clearTimeout(o),a===r&&u===i||(t.stream.videoDimensions={width:a||0,height:u||0},e.sendRequest("streamPropertyChanged",{streamId:t.stream.streamId,property:"videoDimensions",newValue:JSON.stringify(t.stream.videoDimensions),reason:"deviceRotated"},function(n,o){n?console.error("Error sending 'streamPropertyChanged' event",n):(e.session.emitEvent("streamPropertyChanged",[new s.StreamPropertyChangedEvent(e.session,t.stream,"videoDimensions",t.stream.videoDimensions,{width:r,height:i},"deviceRotated")]),t.emitEvent("streamPropertyChanged",[new s.StreamPropertyChangedEvent(t,t.stream,"videoDimensions",t.stream.videoDimensions,{width:r,height:i},"deviceRotated")]))}),clearTimeout(o))}})})}return e.prototype.initSession=function(){return this.session=new o.Session(this),this.session},e.prototype.initPublisher=function(e,t,n){var r;r=t&&"function"!=typeof t?{audioSource:void 0!==(r=t).audioSource?r.audioSource:void 0,frameRate:r.videoSource instanceof MediaStreamTrack?void 0:void 0!==r.frameRate?r.frameRate:void 0,insertMode:void 0!==r.insertMode?"string"==typeof r.insertMode?u.VideoInsertMode[r.insertMode]:r.insertMode:u.VideoInsertMode.APPEND,mirror:void 0===r.mirror||r.mirror,publishAudio:void 0===r.publishAudio||r.publishAudio,publishVideo:void 0===r.publishVideo||r.publishVideo,resolution:r.videoSource instanceof MediaStreamTrack?void 0:void 0!==r.resolution?r.resolution:"640x480",videoSource:void 0!==r.videoSource?r.videoSource:void 0,filter:r.filter}:{insertMode:u.VideoInsertMode.APPEND,mirror:!0,publishAudio:!0,publishVideo:!0,resolution:"640x480"};var o,s=new i.Publisher(e,r,this);return t&&"function"==typeof t?o=t:n&&(o=n),s.initialize().then(function(){void 0!==o&&o(void 0),s.emitEvent("accessAllowed",[])}).catch(function(e){void 0!==o&&o(e),s.emitEvent("accessDenied",[e])}),this.publishers.push(s),s},e.prototype.initPublisherAsync=function(e,t){var n=this;return new Promise(function(r,i){var o,s=function(e){e?i(e):r(o)};o=t?n.initPublisher(e,t,s):n.initPublisher(e,s)})},e.prototype.initLocalRecorder=function(e){return new r.LocalRecorder(e)},e.prototype.checkSystemRequirements=function(){var e=p.name,t=p.ua?p.ua:navigator.userAgent;return"iOS"!==p.os.family||"Safari"===e&&-1===t.indexOf("CriOS")&&-1===t.indexOf("FxiOS")?"Safari"!==e&&"Chrome"!==e&&"Chrome Mobile"!==e&&"Firefox"!==e&&"Firefox Mobile"!==e&&"Opera"!==e&&"Opera Mobile"!==e&&"Android Browser"!==e?0:1:0},e.prototype.checkScreenSharingCapabilities=function(){var e=p.name,t=p.os.family;return"iOS"===t||"Android"===t?0:"Chrome"!==e&&"Firefox"!==e&&"Opera"!==e?0:1},e.prototype.getDevices=function(){return new Promise(function(e,t){navigator.mediaDevices.enumerateDevices().then(function(t){var n=[];t.forEach(function(e){"audioinput"!==e.kind&&"videoinput"!==e.kind
|