text: (this["webpackJsonpmultiparty-meeting"]=this["webpackJsonpmultiparty-meeting"]||[]).push([[8],{665:function(e,t,i){"use strict";i.r(t),i.d(t,"default",(function(){return m}));var n=i(57),r=i(45),a=i(58),o=i(94),s=i.n(o),u=null;s()()&&"function"===typeof window.require&&(u=window.require("electron"));var c=function(){function e(){Object(r.a)(this,e),this._stream=null}return Object(a.a)(e,[{key:"start",value:function(){var e=this;return Promise.resolve().then((function(){return u.desktopCapturer.getSources({types:["window","screen"]})})).then((function(e){var t,i=Object(n.a)(e);try{for(i.s();!(t=i.n()).done;){var r=t.value;if("Entire Screen"===r.name)return navigator.mediaDevices.getUserMedia({audio:!1,video:{mandatory:{chromeMediaSource:"desktop",chromeMediaSourceId:r.id}}})}}catch(a){i.e(a)}finally{i.f()}})).then((function(t){return e._stream=t,t}))}},{key:"stop",value:function(){this._stream instanceof MediaStream!==!1&&(this._stream.getTracks().forEach((function(e){return e.stop()})),this._stream=null)}},{key:"isScreenShareAvailable",value:function(){return!0}}]),e}(),h=function(){function e(){Object(r.a)(this,e),this._stream=null}return Object(a.a)(e,[{key:"start",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=this._toConstraints(t);return navigator.mediaDevices.getDisplayMedia(i).then((function(t){return e._stream=t,Promise.resolve(t)}))}},{key:"stop",value:function(){this._stream instanceof MediaStream!==!1&&(this._stream.getTracks().forEach((function(e){return e.stop()})),this._stream=null)}},{key:"isScreenShareAvailable",value:function(){return!0}},{key:"_toConstraints",value:function(e){var t={video:{}};return isFinite(e.width)&&(t.video.width=e.width),isFinite(e.height)&&(t.video.height=e.height),isFinite(e.frameRate)&&(t.video.frameRate=e.frameRate),t}}]),e}(),f=function(){function e(){Object(r.a)(this,e),this._stream=null}return Object(a.a)(e,[{key:"start",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=this._toConstraints(t);return navigator.mediaDevices.getUserMedia(i).then((function(t){return e._stream=t,Promise.resolve(t)}))}},{key:"stop",value:function(){this._stream instanceof MediaStream!==!1&&(this._stream.getTracks().forEach((function(e){return e.stop()})),this._stream=null)}},{key:"isScreenShareAvailable",value:function(){return!0}},{key:"_toConstraints",value:function(e){var t={video:{mediaSource:"window"},audio:!1};return"mediaSource"in e&&(t.video.mediaSource=e.mediaSource),isFinite(e.width)&&(t.video.width={min:e.width,max:e.width}),isFinite(e.height)&&(t.video.height={min:e.height,max:e.height}),isFinite(e.frameRate)&&(t.video.frameRate={min:e.frameRate,max:e.frameRate}),t}}]),e}(),l=function(){function e(){Object(r.a)(this,e)}return Object(a.a)(e,[{key:"isScreenShareAvailable",value:function(){return!1}}]),e}(),m=function(){function e(){Object(r.a)(this,e)}return Object(a.a)(e,null,[{key:"create",value:function(e){if(s()()&&u)return new c;if("desktop"!==e.platform)return new l;switch(e.flag){case"firefox":return e.version<66?new f:new h;case"safari":return e.version>=13?new h:new l;case"chrome":case"chromium":case"opera":case"edge":return new h;default:return new l}}}]),e}()}}]);
  //# sourceMappingURL=screensharing.8667934a.chunk.js.map