123 |
- var I=function(r,e){return I=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(t[n]=i[n])},I(r,e)};function x(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");I(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}function O(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],i=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&i>=r.length&&(r=void 0),{value:r&&r[i++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function P(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var i=t.call(r),n,o=[],a;try{for(;(e===void 0||e-- >0)&&!(n=i.next()).done;)o.push(n.value)}catch(s){a={error:s}}finally{try{n&&!n.done&&(t=i.return)&&t.call(i)}finally{if(a)throw a.error}}return o}function M(r,e,t){if(t||arguments.length===2)for(var i=0,n=e.length,o;i<n;i++)(o||!(i in e))&&(o||(o=Array.prototype.slice.call(e,0,i)),o[i]=e[i]);return r.concat(o||Array.prototype.slice.call(e))}function g(r){return typeof r=="function"}function G(r){var e=function(i){Error.call(i),i.stack=new Error().stack},t=r(e);return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}var T=G(function(r){return function(t){r(this),this.message=t?t.length+` errors occurred during unsubscription:
- `+t.map(function(i,n){return n+1+") "+i.toString()}).join(`
- `):"",this.name="UnsubscriptionError",this.errors=t}});function j(r,e){if(r){var t=r.indexOf(e);0<=t&&r.splice(t,1)}}var D=function(){function r(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return r.prototype.unsubscribe=function(){var e,t,i,n,o;if(!this.closed){this.closed=!0;var a=this._parentage;if(a)if(this._parentage=null,Array.isArray(a))try{for(var s=O(a),c=s.next();!c.done;c=s.next()){var u=c.value;u.remove(this)}}catch(v){e={error:v}}finally{try{c&&!c.done&&(t=s.return)&&t.call(s)}finally{if(e)throw e.error}}else a.remove(this);var l=this.initialTeardown;if(g(l))try{l()}catch(v){o=v instanceof T?v.errors:[v]}var h=this._finalizers;if(h){this._finalizers=null;try{for(var y=O(h),p=y.next();!p.done;p=y.next()){var f=p.value;try{F(f)}catch(v){o=o!=null?o:[],v instanceof T?o=M(M([],P(o)),P(v.errors)):o.push(v)}}}catch(v){i={error:v}}finally{try{p&&!p.done&&(n=y.return)&&n.call(y)}finally{if(i)throw i.error}}}if(o)throw new T(o)}},r.prototype.add=function(e){var t;if(e&&e!==this)if(this.closed)F(e);else{if(e instanceof r){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=(t=this._finalizers)!==null&&t!==void 0?t:[]).push(e)}},r.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},r.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},r.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&j(t,e)},r.prototype.remove=function(e){var t=this._finalizers;t&&j(t,e),e instanceof r&&e._removeParent(this)},r.EMPTY=function(){var e=new r;return e.closed=!0,e}(),r}(),$=D.EMPTY;function Q(r){return r instanceof D||r&&"closed"in r&&g(r.remove)&&g(r.add)&&g(r.unsubscribe)}function F(r){g(r)?r():r.unsubscribe()}var L={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},U={setTimeout:function(r,e){for(var t=[],i=2;i<arguments.length;i++)t[i-2]=arguments[i];var n=U.delegate;return n!=null&&n.setTimeout?n.setTimeout.apply(n,M([r,e],P(t))):setTimeout.apply(void 0,M([r,e],P(t)))},clearTimeout:function(r){var e=U.delegate;return((e==null?void 0:e.clearTimeout)||clearTimeout)(r)},delegate:void 0};function Z(r){U.setTimeout(function(){throw r})}function V(){}var C=null;function R(r){if(L.useDeprecatedSynchronousErrorHandling){var e=!C;if(e&&(C={errorThrown:!1,error:null}),r(),e){var t=C,i=t.errorThrown,n=t.error;if(C=null,i)throw n}}else r()}var z=function(r){x(e,r);function e(t){var i=r.call(this)||this;return i.isStopped=!1,t?(i.destination=t,Q(t)&&t.add(i)):i.destination=re,i}return e.create=function(t,i,n){return new B(t,i,n)},e.prototype.next=function(t){this.isStopped||this._next(t)},e.prototype.error=function(t){this.isStopped||(this.isStopped=!0,this._error(t))},e.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,r.prototype.unsubscribe.call(this),this.destination=null)},e.prototype._next=function(t){this.destination.next(t)},e.prototype._error=function(t){try{this.destination.error(t)}finally{this.unsubscribe()}},e.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},e}(D),N=Function.prototype.bind;function k(r,e){return N.call(r,e)}var ee=function(){function r(e){this.partialObserver=e}return r.prototype.next=function(e){var t=this.partialObserver;if(t.next)try{t.next(e)}catch(i){A(i)}},r.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(i){A(i)}else A(e)},r.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(t){A(t)}},r}(),B=function(r){x(e,r);function e(t,i,n){var o=r.call(this)||this,a;if(g(t)||!t)a={next:t!=null?t:void 0,error:i!=null?i:void 0,complete:n!=null?n:void 0};else{var s;o&&L.useDeprecatedNextContext?(s=Object.create(t),s.unsubscribe=function(){return o.unsubscribe()},a={next:t.next&&k(t.next,s),error:t.error&&k(t.error,s),complete:t.complete&&k(t.complete,s)}):a=t}return o.destination=new ee(a),o}return e}(z);function A(r){Z(r)}function te(r){throw r}var re={closed:!0,next:V,error:te,complete:V},ie=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function ne(r){return r}function oe(r){return r.length===0?ne:r.length===1?r[0]:function(t){return r.reduce(function(i,n){return n(i)},t)}}var H=function(){function r(e){e&&(this._subscribe=e)}return r.prototype.lift=function(e){var t=new r;return t.source=this,t.operator=e,t},r.prototype.subscribe=function(e,t,i){var n=this,o=ae(e)?e:new B(e,t,i);return R(function(){var a=n,s=a.operator,c=a.source;o.add(s?s.call(o,c):c?n._subscribe(o):n._trySubscribe(o))}),o},r.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){e.error(t)}},r.prototype.forEach=function(e,t){var i=this;return t=W(t),new t(function(n,o){var a=new B({next:function(s){try{e(s)}catch(c){o(c),a.unsubscribe()}},error:o,complete:n});i.subscribe(a)})},r.prototype._subscribe=function(e){var t;return(t=this.source)===null||t===void 0?void 0:t.subscribe(e)},r.prototype[ie]=function(){return this},r.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return oe(e)(this)},r.prototype.toPromise=function(e){var t=this;return e=W(e),new e(function(i,n){var o;t.subscribe(function(a){return o=a},function(a){return n(a)},function(){return i(o)})})},r.create=function(e){return new r(e)},r}();function W(r){var e;return(e=r!=null?r:L.Promise)!==null&&e!==void 0?e:Promise}function se(r){return r&&g(r.next)&&g(r.error)&&g(r.complete)}function ae(r){return r&&r instanceof z||se(r)&&Q(r)}var ue=G(function(r){return function(){r(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),J=function(r){x(e,r);function e(){var t=r.call(this)||this;return t.closed=!1,t.currentObservers=null,t.observers=[],t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return e.prototype.lift=function(t){var i=new q(this,this);return i.operator=t,i},e.prototype._throwIfClosed=function(){if(this.closed)throw new ue},e.prototype.next=function(t){var i=this;R(function(){var n,o;if(i._throwIfClosed(),!i.isStopped){i.currentObservers||(i.currentObservers=Array.from(i.observers));try{for(var a=O(i.currentObservers),s=a.next();!s.done;s=a.next()){var c=s.value;c.next(t)}}catch(u){n={error:u}}finally{try{s&&!s.done&&(o=a.return)&&o.call(a)}finally{if(n)throw n.error}}}})},e.prototype.error=function(t){var i=this;R(function(){if(i._throwIfClosed(),!i.isStopped){i.hasError=i.isStopped=!0,i.thrownError=t;for(var n=i.observers;n.length;)n.shift().error(t)}})},e.prototype.complete=function(){var t=this;R(function(){if(t._throwIfClosed(),!t.isStopped){t.isStopped=!0;for(var i=t.observers;i.length;)i.shift().complete()}})},e.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(e.prototype,"observed",{get:function(){var t;return((t=this.observers)===null||t===void 0?void 0:t.length)>0},enumerable:!1,configurable:!0}),e.prototype._trySubscribe=function(t){return this._throwIfClosed(),r.prototype._trySubscribe.call(this,t)},e.prototype._subscribe=function(t){return this._throwIfClosed(),this._checkFinalizedStatuses(t),this._innerSubscribe(t)},e.prototype._innerSubscribe=function(t){var i=this,n=this,o=n.hasError,a=n.isStopped,s=n.observers;return o||a?$:(this.currentObservers=null,s.push(t),new D(function(){i.currentObservers=null,j(s,t)}))},e.prototype._checkFinalizedStatuses=function(t){var i=this,n=i.hasError,o=i.thrownError,a=i.isStopped;n?t.error(o):a&&t.complete()},e.prototype.asObservable=function(){var t=new H;return t.source=this,t},e.create=function(t,i){return new q(t,i)},e}(H),q=function(r){x(e,r);function e(t,i){var n=r.call(this)||this;return n.destination=t,n.source=i,n}return e.prototype.next=function(t){var i,n;(n=(i=this.destination)===null||i===void 0?void 0:i.next)===null||n===void 0||n.call(i,t)},e.prototype.error=function(t){var i,n;(n=(i=this.destination)===null||i===void 0?void 0:i.error)===null||n===void 0||n.call(i,t)},e.prototype.complete=function(){var t,i;(i=(t=this.destination)===null||t===void 0?void 0:t.complete)===null||i===void 0||i.call(t)},e.prototype._subscribe=function(t){var i,n;return(n=(i=this.source)===null||i===void 0?void 0:i.subscribe(t))!==null&&n!==void 0?n:$},e}(J),ce=function(r){x(e,r);function e(t){var i=r.call(this)||this;return i._value=t,i}return Object.defineProperty(e.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),e.prototype._subscribe=function(t){var i=r.prototype._subscribe.call(this,t);return!i.closed&&t.next(this._value),i},e.prototype.getValue=function(){var t=this,i=t.hasError,n=t.thrownError,o=t._value;if(i)throw n;return this._throwIfClosed(),o},e.prototype.next=function(t){r.prototype.next.call(this,this._value=t)},e}(J);const b=new ce({frameRate:30}),Y=()=>!!navigator.mediaDevices&&!!navigator.mediaDevices.getDisplayMedia;function le(r){const e=document.createElement("video");e.id="simaq-video",e.setAttribute("autoplay","true"),e.setAttribute("mute","true"),e.style.width="600px",e.style.height="400px",e.style.position="fixed",e.style.top="0px",e.style.right="0px",e.style.zIndex="1000",e.style.display=r?"block":"none",document.body.appendChild(e)}function de(){return document.getElementById("simaq-video")}var K={exports:{}};(function(r){var e=Object.prototype.hasOwnProperty,t="~";function i(){}Object.create&&(i.prototype=Object.create(null),new i().__proto__||(t=!1));function n(c,u,l){this.fn=c,this.context=u,this.once=l||!1}function o(c,u,l,h,y){if(typeof l!="function")throw new TypeError("The listener must be a function");var p=new n(l,h||c,y),f=t?t+u:u;return c._events[f]?c._events[f].fn?c._events[f]=[c._events[f],p]:c._events[f].push(p):(c._events[f]=p,c._eventsCount++),c}function a(c,u){--c._eventsCount===0?c._events=new i:delete c._events[u]}function s(){this._events=new i,this._eventsCount=0}s.prototype.eventNames=function(){var u=[],l,h;if(this._eventsCount===0)return u;for(h in l=this._events)e.call(l,h)&&u.push(t?h.slice(1):h);return Object.getOwnPropertySymbols?u.concat(Object.getOwnPropertySymbols(l)):u},s.prototype.listeners=function(u){var l=t?t+u:u,h=this._events[l];if(!h)return[];if(h.fn)return[h.fn];for(var y=0,p=h.length,f=new Array(p);y<p;y++)f[y]=h[y].fn;return f},s.prototype.listenerCount=function(u){var l=t?t+u:u,h=this._events[l];return h?h.fn?1:h.length:0},s.prototype.emit=function(u,l,h,y,p,f){var v=t?t+u:u;if(!this._events[v])return!1;var d=this._events[v],w=arguments.length,S,m;if(d.fn){switch(d.once&&this.removeListener(u,d.fn,void 0,!0),w){case 1:return d.fn.call(d.context),!0;case 2:return d.fn.call(d.context,l),!0;case 3:return d.fn.call(d.context,l,h),!0;case 4:return d.fn.call(d.context,l,h,y),!0;case 5:return d.fn.call(d.context,l,h,y,p),!0;case 6:return d.fn.call(d.context,l,h,y,p,f),!0}for(m=1,S=new Array(w-1);m<w;m++)S[m-1]=arguments[m];d.fn.apply(d.context,S)}else{var X=d.length,E;for(m=0;m<X;m++)switch(d[m].once&&this.removeListener(u,d[m].fn,void 0,!0),w){case 1:d[m].fn.call(d[m].context);break;case 2:d[m].fn.call(d[m].context,l);break;case 3:d[m].fn.call(d[m].context,l,h);break;case 4:d[m].fn.call(d[m].context,l,h,y);break;default:if(!S)for(E=1,S=new Array(w-1);E<w;E++)S[E-1]=arguments[E];d[m].fn.apply(d[m].context,S)}}return!0},s.prototype.on=function(u,l,h){return o(this,u,l,h,!1)},s.prototype.once=function(u,l,h){return o(this,u,l,h,!0)},s.prototype.removeListener=function(u,l,h,y){var p=t?t+u:u;if(!this._events[p])return this;if(!l)return a(this,p),this;var f=this._events[p];if(f.fn)f.fn===l&&(!y||f.once)&&(!h||f.context===h)&&a(this,p);else{for(var v=0,d=[],w=f.length;v<w;v++)(f[v].fn!==l||y&&!f[v].once||h&&f[v].context!==h)&&d.push(f[v]);d.length?this._events[p]=d.length===1?d[0]:d:a(this,p)}return this},s.prototype.removeAllListeners=function(u){var l;return u?(l=t?t+u:u,this._events[l]&&a(this,l)):(this._events=new i,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=t,s.EventEmitter=s,r.exports=s})(K);var _;(function(r){r[r.init=0]="init",r[r.start=1]="start",r[r.hold=2]="hold",r[r.end=3]="end"})(_||(_={}));class he extends K.exports.EventEmitter{constructor(e){super(),this.displayMediaStreamConstraints={video:b.getValue(),preferCurrentTab:!0,audio:!1,systemAudio:"exclude"},this.isStartRecoding=!1,this.status=0,this.recordChunks=[],this.autoDownload=!1,this.passiveEnd=!1,this.disabledAudio=!1,this.systemAudio=!1,this.debug=!1,this.codecType="video/webm;codecs=vp9,opus",this.codecFileType="video/webm",this.sleep=t=>new Promise(i=>setTimeout(i,t)),this.autoDownload=e.autoDownload,this.platform=e.platform,this.platformConfig=e.config,this.uploadUrl=e.uploadUrl,this.disabledAudio=e.disabledAudio,this.debug=e.debug,this.systemAudio=e.systemAudio,this.setSystemAudio(),this.initParams(e),b.subscribe(t=>{this.debug&&console.log("subscribe",t),this.displayMediaStreamConstraints.video=Object.assign({},this.displayMediaStreamConstraints.video,t)}),this.debug&&console.log("arg",e)}get isElectron(){return this.platform==="electron"}get isWeb(){return this.platform==="web"}get isCanvas(){return this.platform==="canvas"}get canvasElement(){return document.querySelector(this.canvasId)}set canvasElement(e){this.canvasElement=e}initParams(e){switch(e.platform){case"web":e.config.frameRate&&(b.value.frameRate=e.config.frameRate);break;case"electron":this.chromeMediaSourceId=e.config.chromeMediaSourceId;break;case"canvas":this.canvasId=e.config.canvasId;break}}setSystemAudio(){this.systemAudio?(this.displayMediaStreamConstraints.systemAudio="include",this.displayMediaStreamConstraints.audio=!0):(this.displayMediaStreamConstraints.systemAudio="exclude",this.displayMediaStreamConstraints.audio=!1)}async startRecord(){try{if(!this.isStartRecoding){if(this.debug&&console.log("\u5F00\u59CB\u5F55\u5C4F\uFF01",Y()),!Y()){console.error("\u5F53\u524D\u6D4F\u89C8\u5668\u4E0D\u652F\u6301\u5F55\u5C4F\u6216\u4E0D\u5B58\u5728https\u73AF\u5883");return}const e=await this.getDefaultMedia();if(this.debug&&console.log("media",e),e){this.emit("startRecord"),this.isStartRecoding=!0,this.status=_.start;const t=de();t&&(t.srcObject=e,this.stream=e,await this.createMediaRecoder(),this.mediaRecorder.start(),this.stream.getVideoTracks()[0].onended=()=>{this.debug&&console.log("stop-share"),this.endRecord()})}else this.streamStop(),this.isStartRecoding=!1,this.status=_.end,this.emit("cancelRecord")}}catch(e){console.error("startRecord::",e)}}getDefaultMedia(){return new Promise(async e=>{switch(this.platform){case"web":return e(await this.getDisplayMedia());case"canvas":return e(await this.getCanvasSteam());case"electron":return e(await this.getEletronDisplayMedia());default:return e(await this.getDisplayMedia())}})}getCanvasSteam(){return new Promise(async e=>{try{const t=await this.getDeaultAudio();t&&(this.audioInput=t),this.debug&&console.log("audioInput",t),console.log("this.canvasElement",this.canvasElement);let i=30;typeof this.platformConfig.frameRate=="number"&&(i=this.platformConfig.frameRate);const n=this.canvasElement.captureStream(i);if(n){const o=n.getVideoTracks()[0];return o&&o.applyConstraints({advanced:[{width:b.value.width,height:b.value.height,frameRate:b.value.frameRate}]}),e(n)}return e(null)}catch{return e(null)}})}getEletronDisplayMedia(){return new Promise(async e=>{try{const t=await this.getEletronDeaultAudio();if(t&&(this.audioInput=t),console.log("eletron-audioInput",t),navigator.mediaDevices.getDisplayMedia){const i={mandatory:{chromeMediaSource:"desktop",chromeMediaSourceId:this.chromeMediaSourceId,minWidth:this.platformConfig.minWidth||1280,maxWidth:this.platformConfig.maxWidth||3840,minHeight:this.platformConfig.minHeight||720,maxHeight:this.platformConfig.maxHeight||2160,maxFrameRate:this.platformConfig.maxFrameRate||30,minFrameRate:this.platformConfig.minFrameRate||30}};this.debug&&console.log("videoConfig",i);const n=await navigator.mediaDevices.getUserMedia({audio:!1,video:i});return e(n)}return e(null)}catch{return e(null)}})}getDisplayMedia(){return new Promise(async e=>{try{const t=await this.getDeaultAudio();if(t&&(this.audioInput=t),this.debug&&console.log("audioInput",t),navigator.mediaDevices.getDisplayMedia){this.debug&&console.log("displayMediaStreamConstraints",this.displayMediaStreamConstraints);const i=await navigator.mediaDevices.getDisplayMedia(this.displayMediaStreamConstraints);return e(i)}return e(null)}catch{return e(null)}})}async getDeaultAudio(){return new Promise(async e=>{try{const t={echoCancellation:!0,autoGainControl:!0,noiseSuppression:!0,latency:0};if(console.log("audioConfig",t),navigator.mediaDevices.getUserMedia){const i=await navigator.mediaDevices.getUserMedia({audio:t,video:!1});return e(i)}return e(null)}catch{return e(null)}})}async getEletronDeaultAudio(){return new Promise(async e=>{try{if(navigator.mediaDevices.getUserMedia){const t=await navigator.mediaDevices.getUserMedia({video:!1,audio:{deviceId:"default"}});return e(t)}return e(null)}catch{return e(null)}})}holdRecord(){this.isStartRecoding=!1,this.status=_.hold,this.streamStop()}async endRecord(){return new Promise(async e=>{try{this.streamStop(),await this.sleep(1e3),this.isStartRecoding=!1,this.status=_.end;const t=this.recordChunks.slice();console.log("last-dump",t),this.autoDownload&&t!=null&&t.length&&this.handleAutoDownload(t),this.emit("endRecord",t),this.passiveEnd=!1,this.recordChunks=[],e(t)}catch{this.emit("endRecord",null),e([])}})}streamStop(){this.stream&&this.stream.getTracks().forEach(e=>e.stop()),this.audioInput&&this.audioInput.getTracks().forEach(e=>e.stop()),this.mediaRecorder&&this.mediaRecorder.stop()}async createMediaRecoder(){try{let e,t;this.audioInput&&([t]=this.stream.getVideoTracks(),[e]=this.audioInput.getAudioTracks(),this.stream=new MediaStream([t,e]));const i=window.Howler;if((i==null?void 0:i.ctx)&&!this.disabledAudio){const o=i.ctx.createMediaStreamDestination();i.masterGain.connect(o),console.log("streamDest",o),window.streamAudio=o,[t]=this.stream.getVideoTracks(),[e]=o.stream.getAudioTracks(),console.log("audioTrack",e),e.onended=a=>{console.log("audioTrack-end",a),this.mediaRecorder.stop()},this.stream=new MediaStream([t,e])}const n=new MediaRecorder(this.stream,{mimeType:this.codecType,audioBitsPerSecond:b.value.audioBitsPerSecond,videoBitsPerSecond:b.value.videoBitsPerSecond});this.mediaRecorder=n,window.__SIMAQ__=n,this.mediaRecorder.ondataavailable=o=>{this.recordChunks.push(o.data),this.emit("record",new Blob([o.data],{type:this.codecFileType}))},this.mediaRecorder.stop=()=>{},this.mediaRecorder.onerror=o=>{console.error(`onerror stream: ${o.error.name},`,o)},this.mediaRecorder.onstop=o=>{console.warn("onstop stream:",o)},this.mediaRecorder.onpause=o=>{console.warn("onpause stream: ",o)},this.mediaRecorder.onresume=o=>{console.warn("onresume stream: ",o)}}catch(e){console.error("error",e)}}handleAutoDownload(e){const t=new Blob(e,{type:this.codecFileType}),i=URL.createObjectURL(t),n=document.createElement("a");document.body.appendChild(n),n.style.display="none",n.href=i;const o=new Date().getTime();n.download=`${o}.webm`,n.click(),window.URL.revokeObjectURL(i)}updateCanvas(e){this.isCanvas&&(this.canvasElement=e)}}class fe extends he{constructor(e){super(e),this.init(e)}init(e){if(document.addEventListener("DOMContentLoaded",le.apply(this,[e.debugShowVideo])),e!=null&&e.resolution)switch(e.resolution){case"4k":b.next({...b.value,width:3840,height:2160,audioBitsPerSecond:128e3,videoBitsPerSecond:12e6});break;case"2k":b.next({...b.value,width:2560,height:1440,audioBitsPerSecond:128e3,videoBitsPerSecond:65e5});break;case"1080p":b.next({...b.value,width:1920,height:1080,audioBitsPerSecond:128e3,videoBitsPerSecond:25e5});break}}}export{fe as V};
|