-
Notifications
You must be signed in to change notification settings - Fork 2
/
videoRTP.min.js
1 lines (1 loc) · 34 KB
/
videoRTP.min.js
1
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t=t||self).videoRTP={})}(this,function(t){"use strict";function f(t){return isNaN(t=+t)?0:(0<t?o:n)(t)}function u(t){if(null==t)throw TypeError("Can't call method on "+t);return t}function e(a){return function(t,e){var r,n,o=String(u(t)),i=f(e),c=o.length;return i<0||c<=i?a?"":void 0:(r=o.charCodeAt(i))<55296||56319<r||i+1===c||(n=o.charCodeAt(i+1))<56320||57343<n?a?o.charAt(i):r:a?o.slice(i,i+2):n-56320+(r-55296<<10)+65536}}var r=Object.freeze({__proto__:null}),n=Math.ceil,o=Math.floor,i={codeAt:e(!1),charAt:e(!0)},c="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function a(t,e){return t(e={exports:{}},e.exports),e.exports}function s(t){return t&&t.Math==Math&&t}function l(t){try{return!!t()}catch(t){return!0}}function p(t){return"object"==typeof t?null!==t:"function"==typeof t}function d(t){return w?m.createElement(t):{}}function v(t){if(!p(t))throw TypeError(String(t)+" is not an object");return t}function h(t,e){if(!p(t))return t;var r,n;if(e&&"function"==typeof(r=t.toString)&&!p(n=r.call(t)))return n;if("function"==typeof(r=t.valueOf)&&!p(n=r.call(t)))return n;if(!e&&"function"==typeof(r=t.toString)&&!p(n=r.call(t)))return n;throw TypeError("Can't convert object to primitive value")}function b(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}var g=s("object"==typeof globalThis&&globalThis)||s("object"==typeof window&&window)||s("object"==typeof self&&self)||s("object"==typeof c&&c)||Function("return this")(),y=!l(function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}),m=g.document,w=p(m)&&p(m.createElement),S=!y&&!l(function(){return 7!=Object.defineProperty(d("div"),"a",{get:function(){return 7}}).a}),j=Object.defineProperty,E={f:y?j:function(t,e,r){if(v(t),e=h(e,!0),v(r),S)try{return j(t,e,r)}catch(t){}if("get"in r||"set"in r)throw TypeError("Accessors not supported");return"value"in r&&(t[e]=r.value),t}},x=y?function(t,e,r){return E.f(t,e,b(1,r))}:function(t,e,r){return t[e]=r,t},O="__core-js_shared__",T=g[O]||function(e,r){try{x(g,e,r)}catch(t){g[e]=r}return r}(O,{}),L=Function.toString;"function"!=typeof T.inspectSource&&(T.inspectSource=function(t){return L.call(t)});function A(t,e){return z.call(t,e)}function P(t){return"Symbol("+String(void 0===t?"":t)+")_"+(++W+q).toString(36)}function k(t){return B[t]||(B[t]=P(t))}var M,_,I,R,F,N,C,G,D=T.inspectSource,U=g.WeakMap,V="function"==typeof U&&/native code/.test(D(U)),z={}.hasOwnProperty,H=a(function(t){(t.exports=function(t,e){return T[t]||(T[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.6.4",mode:"pure",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})}),W=0,q=Math.random(),B=H("keys"),Y={},X=g.WeakMap;C=V?(M=new X,_=M.get,I=M.has,R=M.set,F=function(t,e){return R.call(M,t,e),e},N=function(t){return _.call(M,t)||{}},function(t){return I.call(M,t)}):(G=k("state"),Y[G]=!0,F=function(t,e){return x(t,G,e),e},N=function(t){return A(t,G)?t[G]:{}},function(t){return A(t,G)});function Z(t){return lt.call(t).slice(8,-1)}function K(t){return dt(u(t))}function J(t,e){var r=mt[gt(t)];return r==bt||r!=wt&&("function"==typeof e?l(e):!!e)}function Q(t){if("function"!=typeof t)throw TypeError(String(t)+" is not a function");return t}function $(n,o,t){if(Q(n),void 0===o)return n;switch(t){case 0:return function(){return n.call(o)};case 1:return function(t){return n.call(o,t)};case 2:return function(t,e){return n.call(o,t,e)};case 3:return function(t,e,r){return n.call(o,t,e,r)}}return function(){return n.apply(o,arguments)}}function tt(n){function t(t,e,r){if(this instanceof n){switch(arguments.length){case 0:return new n;case 1:return new n(t);case 2:return new n(t,e)}return new n(t,e,r)}return n.apply(this,arguments)}return t.prototype=n.prototype,t}function et(t,e){var r,n,o,i,c,a,u,s,f=t.target,l=t.global,p=t.stat,d=t.proto,h=l?g:p?g[f]:(g[f]||{}).prototype,v=l?jt:jt[f]||(jt[f]={}),y=v.prototype;for(o in e)r=!St(l?o:f+(p?".":"#")+o,t.forced)&&h&&A(h,o),c=v[o],r&&(a=t.noTargetGet?(s=Et(h,o))&&s.value:h[o]),i=r&&a?a:e[o],r&&typeof c==typeof i||(u=t.bind&&r?$(i,g):t.wrap&&r?tt(i):d&&"function"==typeof i?$(Function.call,i):i,(t.sham||i&&i.sham||c&&c.sham)&&x(u,"sham",!0),v[o]=u,d&&(A(jt,n=f+"Prototype")||x(jt,n,{}),jt[n][o]=i,t.real&&y&&!y[o]&&x(y,o,i)))}function rt(t){return Object(u(t))}function nt(t){return A(kt,t)||(At&&A(Mt,t)?kt[t]=Mt[t]:kt[t]=_t("Symbol."+t)),kt[t]}var ot,it,ct,at={set:F,get:N,has:C,enforce:function(t){return C(t)?N(t):F(t,{})},getterFor:function(r){return function(t){var e;if(!p(t)||(e=N(t)).type!==r)throw TypeError("Incompatible receiver, "+r+" required");return e}}},ut={}.propertyIsEnumerable,st=Object.getOwnPropertyDescriptor,ft={f:st&&!ut.call({1:2},1)?function(t){var e=st(this,t);return!!e&&e.enumerable}:ut},lt={}.toString,pt="".split,dt=l(function(){return!Object("z").propertyIsEnumerable(0)})?function(t){return"String"==Z(t)?pt.call(t,""):Object(t)}:Object,ht=Object.getOwnPropertyDescriptor,vt={f:y?ht:function(t,e){if(t=K(t),e=h(e,!0),S)try{return ht(t,e)}catch(t){}if(A(t,e))return b(!ft.f.call(t,e),t[e])}},yt=/#|\.prototype\./,gt=J.normalize=function(t){return String(t).replace(yt,".").toLowerCase()},mt=J.data={},wt=J.NATIVE="N",bt=J.POLYFILL="P",St=J,jt={},Et=vt.f,xt=!l(function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype}),Ot=k("IE_PROTO"),Tt=Object.prototype,Lt=xt?Object.getPrototypeOf:function(t){return t=rt(t),A(t,Ot)?t[Ot]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?Tt:null},At=!!Object.getOwnPropertySymbols&&!l(function(){return!String(Symbol())}),Pt=At&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,kt=H("wks"),Mt=g.Symbol,_t=Pt?Mt:Mt&&Mt.withoutSetter||P,It=(nt("iterator"),!1);[].keys&&("next"in(ct=[].keys())?(it=Lt(Lt(ct)))!==Object.prototype&&(ot=it):It=!0),null==ot&&(ot={});function Rt(t){return 0<t?zt(f(t),9007199254740991):0}function Ft(s){return function(t,e,r){var n,o,i,c=K(t),a=Rt(c.length),u=(n=a,(o=f(r))<0?Ht(o+n,0):Wt(o,n));if(s&&e!=e){for(;u<a;)if((i=c[u++])!=i)return!0}else for(;u<a;u++)if((s||u in c)&&c[u]===e)return s||u||0;return!s&&-1}}function Nt(t){return"function"==typeof t?t:void 0}function Ct(t,e){return arguments.length<2?Nt(jt[t])||Nt(g[t]):jt[t]&&jt[t][e]||g[t]&&g[t][e]}function Gt(){}function Dt(t){return"<script>"+t+"</"+Jt+">"}var Ut,Vt={IteratorPrototype:ot,BUGGY_SAFARI_ITERATORS:It},zt=Math.min,Ht=Math.max,Wt=Math.min,qt={includes:Ft(!0),indexOf:Ft(!1)}.indexOf,Bt=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Yt=Object.keys||function(t){return function(t,e){var r,n=K(t),o=0,i=[];for(r in n)!A(Y,r)&&A(n,r)&&i.push(r);for(;e.length>o;)A(n,r=e[o++])&&(~qt(i,r)||i.push(r));return i}(t,Bt)},Xt=y?Object.defineProperties:function(t,e){v(t);for(var r,n=Yt(e),o=n.length,i=0;i<o;)E.f(t,r=n[i++],e[r]);return t},Zt=Ct("document","documentElement"),Kt="prototype",Jt="script",Qt=k("IE_PROTO"),$t=function(){try{Ut=document.domain&&new ActiveXObject("htmlfile")}catch(t){}var t,e;$t=Ut?function(t){t.write(Dt("")),t.close();var e=t.parentWindow.Object;return t=null,e}(Ut):((e=d("iframe")).style.display="none",Zt.appendChild(e),e.src=String("javascript:"),(t=e.contentWindow.document).open(),t.write(Dt("document.F=Object")),t.close(),t.F);for(var r=Bt.length;r--;)delete $t[Kt][Bt[r]];return $t()};Y[Qt]=!0;var te=Object.create||function(t,e){var r;return null!==t?(Gt[Kt]=v(t),r=new Gt,Gt[Kt]=null,r[Qt]=t):r=$t(),void 0===e?r:Xt(r,e)},ee={};ee[nt("toStringTag")]="z";function re(t,e,r,n){var o;t&&(o=r?t:t.prototype,A(o,de)||pe(o,de,{configurable:!0,value:e}),n&&!ae&&x(o,"toString",le))}function ne(){return this}function oe(t,e,r,n){n&&n.enumerable?t[e]=r:x(t,e,r)}function ie(){return this}function ce(t,e,r,n,o,i,c){var a,u,s;function f(t){if(t===o&&m)return m;if(!me&&t in y)return y[t];switch(t){case"keys":case be:case Se:return function(){return new r(this,t)}}return function(){return new r(this)}}u=n,s=e+" Iterator",(a=r).prototype=te(ve,{next:b(1,u)}),re(a,s,!1,!0),he[s]=ne;var l,p,d,h=e+" Iterator",v=!1,y=t.prototype,g=y[we]||y["@@iterator"]||o&&y[o],m=!me&&g||f(o),w="Array"==e&&y.entries||g;if(w&&(l=Lt(w.call(new t)),ge!==Object.prototype&&l.next&&(re(l,h,!0,!0),he[h]=ie)),o==be&&g&&g.name!==be&&(v=!0,m=function(){return g.call(this)}),c&&y[we]!==m&&x(y,we,m),he[e]=m,o)if(p={values:f(be),keys:i?m:f("keys"),entries:f(Se)},c)for(d in p)!me&&!v&&d in y||oe(y,d,p[d]);else et({target:e,proto:!0,forced:me||v},p);return p}var ae="[object z]"===String(ee),ue=nt("toStringTag"),se="Arguments"==Z(function(){return arguments}()),fe=ae?Z:function(t){var e,r,n;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(r=function(t,e){try{return t[e]}catch(t){}}(e=Object(t),ue))?r:se?Z(e):"Object"==(n=Z(e))&&"function"==typeof e.callee?"Arguments":n},le=ae?{}.toString:function(){return"[object "+fe(this)+"]"},pe=E.f,de=nt("toStringTag"),he={},ve=Vt.IteratorPrototype,ye=Object.setPrototypeOf||("__proto__"in{}?function(){var r,n=!1,t={};try{(r=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set).call(t,[]),n=t instanceof Array}catch(t){}return function(t,e){return v(t),function(t){if(!p(t)&&null!==t)throw TypeError("Can't set "+String(t)+" as a prototype")}(e),n?r.call(t,e):t.__proto__=e,t}}():void 0),ge=Vt.IteratorPrototype,me=Vt.BUGGY_SAFARI_ITERATORS,we=nt("iterator"),be="values",Se="entries",je=i.charAt,Ee="String Iterator",xe=at.set,Oe=at.getterFor(Ee);ce(String,"String",function(t){xe(this,{type:Ee,string:String(t),index:0})},function(){var t,e=Oe(this),r=e.string,n=e.index;return n>=r.length?{value:void 0,done:!0}:(t=je(r,n),e.index+=t.length,{value:t,done:!1})});var Te="Array Iterator",Le=at.set,Ae=at.getterFor(Te);ce(Array,"Array",function(t,e){Le(this,{type:Te,target:K(t),index:0,kind:e})},function(){var t=Ae(this),e=t.target,r=t.kind,n=t.index++;return!e||n>=e.length?{value:t.target=void 0,done:!0}:"keys"==r?{value:n,done:!1}:"values"==r?{value:e[n],done:!1}:{value:[n,e[n]],done:!1}},"values");he.Arguments=he.Array;var Pe=nt("toStringTag");for(var ke in{CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}){var Me=g[ke],_e=Me&&Me.prototype;_e&&fe(_e)!==Pe&&x(_e,Pe,ke),he[ke]=he.Array}var Ie=g.Promise,Re=nt("species"),Fe=nt("iterator"),Ne=Array.prototype,Ce=nt("iterator"),Ge=a(function(t){function h(t,e){this.stopped=t,this.result=e}(t.exports=function(t,e,r,n,o){var i,c,a,u,s,f,l,p,d=$(e,r,n?2:1);if(o)i=t;else{if("function"!=typeof(c=function(t){if(null!=t)return t[Ce]||t["@@iterator"]||he[fe(t)]}(t)))throw TypeError("Target is not iterable");if(void 0!==(p=c)&&(he.Array===p||Ne[Fe]===p)){for(a=0,u=Rt(t.length);a<u;a++)if((s=n?d(v(l=t[a])[0],l[1]):d(t[a]))&&s instanceof h)return s;return new h(!1)}i=c.call(t)}for(f=i.next;!(l=f.call(i)).done;)if("object"==typeof(s=function(e,t,r,n){try{return n?t(v(r)[0],r[1]):t(r)}catch(t){var o=e.return;throw void 0!==o&&v(o.call(e)),t}}(i,d,l.value,n))&&s&&s instanceof h)return s;return new h(!1)}).stop=function(t){return new h(!0,t)}}),De=nt("iterator"),Ue=!1;try{var Ve=0,ze={next:function(){return{done:!!Ve++}},return:function(){Ue=!0}};ze[De]=function(){return this},Array.from(ze,function(){throw 2})}catch(t){}function He(t,e){var r,n=v(t).constructor;return void 0===n||null==(r=v(n)[Je])?e:Q(r)}function We(t){var e;ar.hasOwnProperty(t)&&(e=ar[t],delete ar[t],e())}function qe(t){return function(){We(t)}}function Be(t){We(t.data)}function Ye(t){g.postMessage(t+"",tr.protocol+"//"+tr.host)}var Xe,Ze,Ke,Je=nt("species"),Qe=Ct("navigator","userAgent")||"",$e=/(iphone|ipod|ipad).*applewebkit/i.test(Qe),tr=g.location,er=g.setImmediate,rr=g.clearImmediate,nr=g.process,or=g.MessageChannel,ir=g.Dispatch,cr=0,ar={},ur="onreadystatechange";er&&rr||(er=function(t){for(var e=[],r=1;r<arguments.length;)e.push(arguments[r++]);return ar[++cr]=function(){("function"==typeof t?t:Function(t)).apply(void 0,e)},Xe(cr),cr},rr=function(t){delete ar[t]},"process"==Z(nr)?Xe=function(t){nr.nextTick(qe(t))}:ir&&ir.now?Xe=function(t){ir.now(qe(t))}:or&&!$e?(Ke=(Ze=new or).port2,Ze.port1.onmessage=Be,Xe=$(Ke.postMessage,Ke,1)):!g.addEventListener||"function"!=typeof postMessage||g.importScripts||l(Ye)||"file:"===tr.protocol?Xe=ur in d("script")?function(t){Zt.appendChild(d("script"))[ur]=function(){Zt.removeChild(this),We(t)}}:function(t){setTimeout(qe(t),0)}:(Xe=Ye,g.addEventListener("message",Be,!1)));var sr,fr,lr,pr,dr,hr,vr,yr,gr={set:er,clear:rr},mr=vt.f,wr=gr.set,br=g.MutationObserver||g.WebKitMutationObserver,Sr=g.process,jr=g.Promise,Er="process"==Z(Sr),xr=mr(g,"queueMicrotask"),Or=xr&&xr.value;Or||(sr=function(){var t,e;for(Er&&(t=Sr.domain)&&t.exit();fr;){e=fr.fn,fr=fr.next;try{e()}catch(t){throw fr?pr():lr=void 0,t}}lr=void 0,t&&t.enter()},pr=Er?function(){Sr.nextTick(sr)}:br&&!$e?(dr=!0,hr=document.createTextNode(""),new br(sr).observe(hr,{characterData:!0}),function(){hr.data=dr=!dr}):jr&&jr.resolve?(vr=jr.resolve(void 0),yr=vr.then,function(){yr.call(vr,sr)}):function(){wr.call(g,sr)});function Tr(t){var r,n;this.promise=new t(function(t,e){if(void 0!==r||void 0!==n)throw TypeError("Bad Promise constructor");r=t,n=e}),this.resolve=Q(r),this.reject=Q(n)}function Lr(t,e){if(v(t),p(e)&&e.constructor===t)return e;var r=_r.f(t);return(0,r.resolve)(e),r.promise}function Ar(t){try{return{error:!1,value:t()}}catch(t){return{error:!0,value:t}}}var Pr,kr,Mr=Or||function(t){var e={fn:t,next:void 0};lr&&(lr.next=e),fr||(fr=e,pr()),lr=e},_r={f:function(t){return new Tr(t)}},Ir=g.process,Rr=Ir&&Ir.versions,Fr=Rr&&Rr.v8;Fr?kr=(Pr=Fr.split("."))[0]+Pr[1]:Qe&&(!(Pr=Qe.match(/Edge\/(\d+)/))||74<=Pr[1])&&(Pr=Qe.match(/Chrome\/(\d+)/))&&(kr=Pr[1]);function Nr(t){var e;return!(!p(t)||"function"!=typeof(e=t.then))&&e}function Cr(l,p,d){var h;p.notified||(p.notified=!0,h=p.reactions,Mr(function(){for(var t=p.value,e=1==p.state,r=0;h.length>r;){var n,o,i,c=h[r++],a=e?c.ok:c.fail,u=c.resolve,s=c.reject,f=c.domain;try{a?(e||(2===p.rejection&&dn(l,p),p.rejection=1),!0===a?n=t:(f&&f.enter(),n=a(t),f&&(f.exit(),i=!0)),n===c.promise?s(tn("Promise-chain cycle")):(o=Nr(n))?o.call(n,u,s):u(n)):s(t)}catch(t){f&&!i&&f.exit(),s(t)}}p.reactions=[],p.notified=!1,d&&!p.rejection&&ln(l,p)}))}function Gr(t,e,r){var n,o;an?((n=en.createEvent("Event")).promise=e,n.reason=r,n.initEvent(t,!1,!0),g.dispatchEvent(n)):n={promise:e,reason:r},(o=g["on"+t])?o(n):t===un&&function(t,e){var r=g.console;r&&r.error&&(1===arguments.length?r.error(t):r.error(t,e))}("Unhandled promise rejection",r)}function Dr(e,r,n,o){return function(t){e(r,n,t,o)}}function Ur(t,e,r,n){e.done||(e.done=!0,n&&(e=n),e.value=r,e.state=2,Cr(t,e,!0))}var Vr,zr,Hr,Wr,qr,Br=kr&&+kr,Yr=gr.set,Xr=nt("species"),Zr="Promise",Kr=at.get,Jr=at.set,Qr=at.getterFor(Zr),$r=Ie,tn=g.TypeError,en=g.document,rn=g.process,nn=(Ct("fetch"),_r.f),on=nn,cn="process"==Z(rn),an=!!(en&&en.createEvent&&g.dispatchEvent),un="unhandledrejection",sn=St(Zr,function(){if(!(D($r)!==String($r))){if(66===Br)return!0;if(!cn&&"function"!=typeof PromiseRejectionEvent)return!0}if(!$r.prototype.finally)return!0;if(51<=Br&&/native code/.test($r))return!1;function t(t){t(function(){},function(){})}var e=$r.resolve(1);return(e.constructor={})[Xr]=t,!(e.then(function(){})instanceof t)}),fn=sn||!function(t,e){if(!e&&!Ue)return!1;var r=!1;try{var n={};n[De]=function(){return{next:function(){return{done:r=!0}}}},t(n)}catch(t){}return r}(function(t){$r.all(t).catch(function(){})}),ln=function(r,n){Yr.call(g,function(){var t,e=n.value;if(pn(n)&&(t=Ar(function(){cn?rn.emit("unhandledRejection",e,r):Gr(un,r,e)}),n.rejection=cn||pn(n)?2:1,t.error))throw t.value})},pn=function(t){return 1!==t.rejection&&!t.parent},dn=function(t,e){Yr.call(g,function(){cn?rn.emit("rejectionHandled",t):Gr("rejectionhandled",t,e.value)})},hn=function(r,n,t,e){if(!n.done){n.done=!0,e&&(n=e);try{if(r===t)throw tn("Promise can't be resolved itself");var o=Nr(t);o?Mr(function(){var e={done:!1};try{o.call(t,Dr(hn,r,e,n),Dr(Ur,r,e,n))}catch(t){Ur(r,e,t,n)}}):(n.value=t,n.state=1,Cr(r,n,!1))}catch(t){Ur(r,{done:!1},t,n)}}};sn&&($r=function(t){!function(t,e,r){if(!(t instanceof e))throw TypeError("Incorrect "+(r?r+" ":"")+"invocation")}(this,$r,Zr),Q(t),Vr.call(this);var e=Kr(this);try{t(Dr(hn,this,e),Dr(Ur,this,e))}catch(t){Ur(this,e,t)}},(Vr=function(){Jr(this,{type:Zr,done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:0,value:void 0})}).prototype=function(t,e,r){for(var n in e)r&&r.unsafe&&t[n]?t[n]=e[n]:oe(t,n,e[n],r);return t}($r.prototype,{then:function(t,e){var r=Qr(this),n=nn(He(this,$r));return n.ok="function"!=typeof t||t,n.fail="function"==typeof e&&e,n.domain=cn?rn.domain:void 0,r.parent=!0,r.reactions.push(n),0!=r.state&&Cr(this,r,!1),n.promise},catch:function(t){return this.then(void 0,t)}}),zr=function(){var t=new Vr,e=Kr(t);this.promise=t,this.resolve=Dr(hn,t,e),this.reject=Dr(Ur,t,e)},_r.f=nn=function(t){return t===$r||t===Hr?new zr:on(t)}),et({global:!0,wrap:!0,forced:sn},{Promise:$r}),re($r,Zr,!1,!0),Wr=Ct(Zr),qr=E.f,y&&Wr&&!Wr[Re]&&qr(Wr,Re,{configurable:!0,get:function(){return this}}),Hr=Ct(Zr),et({target:Zr,stat:!0,forced:sn},{reject:function(t){var e=nn(this);return e.reject.call(void 0,t),e.promise}}),et({target:Zr,stat:!0,forced:!0},{resolve:function(t){return Lr(this===Hr?$r:this,t)}}),et({target:Zr,stat:!0,forced:fn},{all:function(t){var a=this,e=nn(a),u=e.resolve,s=e.reject,r=Ar(function(){var n=Q(a.resolve),o=[],i=0,c=1;Ge(t,function(t){var e=i++,r=!1;o.push(void 0),c++,n.call(a,t).then(function(t){r||(r=!0,o[e]=t,--c||u(o))},s)}),--c||u(o)});return r.error&&s(r.value),e.promise},race:function(t){var r=this,n=nn(r),o=n.reject,e=Ar(function(){var e=Q(r.resolve);Ge(t,function(t){e.call(r,t).then(n.resolve,o)})});return e.error&&o(e.value),n.promise}}),et({target:"Promise",stat:!0},{allSettled:function(t){var a=this,e=_r.f(a),u=e.resolve,r=e.reject,n=Ar(function(){var n=Q(a.resolve),o=[],i=0,c=1;Ge(t,function(t){var e=i++,r=!1;o.push(void 0),c++,n.call(a,t).then(function(t){r||(r=!0,o[e]={status:"fulfilled",value:t},--c||u(o))},function(t){r||(r=!0,o[e]={status:"rejected",reason:t},--c||u(o))})}),--c||u(o)});return n.error&&r(n.value),e.promise}});var vn,yn=!!Ie&&l(function(){Ie.prototype.finally.call({then:function(){}},function(){})});et({target:"Promise",proto:!0,real:!0,forced:yn},{finally:function(e){var r=He(this,Ct("Promise")),t="function"==typeof e;return this.then(t?function(t){return Lr(r,e()).then(function(){return t})}:e,t?function(t){return Lr(r,e()).then(function(){throw t})}:e)}}),(vn=r)&&vn.default;var gn=jt.Promise,mn=at.set,wn=at.getterFor("AggregateError"),bn=function(t,e){var r=this;if(!(r instanceof bn))return new bn(t,e);ye&&(r=ye(new Error(e),Lt(r)));var n=[];return Ge(t,n.push,n),y?mn(r,{errors:n,type:"AggregateError"}):r.errors=n,void 0!==e&&x(r,"message",String(e)),r};bn.prototype=te(Error.prototype,{constructor:b(5,bn),message:b(5,""),name:b(5,"AggregateError")}),y&&E.f(bn.prototype,"errors",{get:function(){return wn(this).errors},configurable:!0}),et({global:!0},{AggregateError:bn}),et({target:"Promise",stat:!0},{try:function(t){var e=_r.f(this),r=Ar(t);return(r.error?e.reject:e.resolve)(r.value),e.promise}});var Sn="No one promise resolved";et({target:"Promise",stat:!0},{any:function(t){var u=this,e=_r.f(u),s=e.resolve,f=e.reject,r=Ar(function(){var n=Q(u.resolve),o=[],i=0,c=1,a=!1;Ge(t,function(t){var e=i++,r=!1;o.push(void 0),c++,n.call(u,t).then(function(t){r||a||(a=!0,s(t))},function(t){r||a||(r=!0,o[e]=t,--c||f(new(Ct("AggregateError"))(o,Sn)))})}),--c||f(new(Ct("AggregateError"))(o,Sn))});return r.error&&f(r.value),e.promise}});var jn=gn,En=a(function(t){var e=function(c){var l,t=Object.prototype,f=t.hasOwnProperty,e="function"==typeof Symbol?Symbol:{},o=e.iterator||"@@iterator",r=e.asyncIterator||"@@asyncIterator",n=e.toStringTag||"@@toStringTag";function a(t,e,r,n){var i,c,a,u,o=e&&e.prototype instanceof m?e:m,s=Object.create(o.prototype),f=new T(n||[]);return s._invoke=(i=t,c=r,a=f,u=d,function(t,e){if(u===v)throw new Error("Generator is already running");if(u===y){if("throw"===t)throw e;return A()}for(a.method=t,a.arg=e;;){var r=a.delegate;if(r){var n=function t(e,r){var n=e.iterator[r.method];if(n===l){if(r.delegate=null,"throw"===r.method){if(e.iterator.return&&(r.method="return",r.arg=l,t(e,r),"throw"===r.method))return g;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return g}var o=p(n,e.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,g;var i=o.arg;return i?i.done?(r[e.resultName]=i.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=l),r.delegate=null,g):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}(r,a);if(n){if(n===g)continue;return n}}if("next"===a.method)a.sent=a._sent=a.arg;else if("throw"===a.method){if(u===d)throw u=y,a.arg;a.dispatchException(a.arg)}else"return"===a.method&&a.abrupt("return",a.arg);u=v;var o=p(i,c,a);if("normal"===o.type){if(u=a.done?y:h,o.arg===g)continue;return{value:o.arg,done:a.done}}"throw"===o.type&&(u=y,a.method="throw",a.arg=o.arg)}}),s}function p(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}c.wrap=a;var d="suspendedStart",h="suspendedYield",v="executing",y="completed",g={};function m(){}function i(){}function u(){}var s={};s[o]=function(){return this};var w=Object.getPrototypeOf,b=w&&w(w(L([])));b&&b!==t&&f.call(b,o)&&(s=b);var S=u.prototype=m.prototype=Object.create(s);function j(t){["next","throw","return"].forEach(function(e){t[e]=function(t){return this._invoke(e,t)}})}function E(u,s){var e;this._invoke=function(r,n){function t(){return new s(function(t,e){!function e(t,r,n,o){var i=p(u[t],u,r);if("throw"!==i.type){var c=i.arg,a=c.value;return a&&"object"==typeof a&&f.call(a,"__await")?s.resolve(a.__await).then(function(t){e("next",t,n,o)},function(t){e("throw",t,n,o)}):s.resolve(a).then(function(t){c.value=t,n(c)},function(t){return e("throw",t,n,o)})}o(i.arg)}(r,n,t,e)})}return e=e?e.then(t,t):t()}}function x(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function O(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function T(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(x,this),this.reset(!0)}function L(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,n=function t(){for(;++r<e.length;)if(f.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=l,t.done=!0,t};return n.next=n}}return{next:A}}function A(){return{value:l,done:!0}}return i.prototype=S.constructor=u,u.constructor=i,u[n]=i.displayName="GeneratorFunction",c.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===i||"GeneratorFunction"===(e.displayName||e.name))},c.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,u):(t.__proto__=u,n in t||(t[n]="GeneratorFunction")),t.prototype=Object.create(S),t},c.awrap=function(t){return{__await:t}},j(E.prototype),E.prototype[r]=function(){return this},c.AsyncIterator=E,c.async=function(t,e,r,n,o){void 0===o&&(o=Promise);var i=new E(a(t,e,r,n),o);return c.isGeneratorFunction(e)?i:i.next().then(function(t){return t.done?t.value:i.next()})},j(S),S[n]="Generator",S[o]=function(){return this},S.toString=function(){return"[object Generator]"},c.keys=function(r){var n=[];for(var t in r)n.push(t);return n.reverse(),function t(){for(;n.length;){var e=n.pop();if(e in r)return t.value=e,t.done=!1,t}return t.done=!0,t}},c.values=L,T.prototype={constructor:T,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=l,this.done=!1,this.delegate=null,this.method="next",this.arg=l,this.tryEntries.forEach(O),!t)for(var e in this)"t"===e.charAt(0)&&f.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=l)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(r){if(this.done)throw r;var n=this;function t(t,e){return i.type="throw",i.arg=r,n.next=t,e&&(n.method="next",n.arg=l),!!e}for(var e=this.tryEntries.length-1;0<=e;--e){var o=this.tryEntries[e],i=o.completion;if("root"===o.tryLoc)return t("end");if(o.tryLoc<=this.prev){var c=f.call(o,"catchLoc"),a=f.call(o,"finallyLoc");if(c&&a){if(this.prev<o.catchLoc)return t(o.catchLoc,!0);if(this.prev<o.finallyLoc)return t(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return t(o.catchLoc,!0)}else{if(!a)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return t(o.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;0<=r;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&f.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=t,i.arg=e,o?(this.method="next",this.next=o.finallyLoc,g):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),g},finish:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),O(r),g}},catch:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n,o=r.completion;return"throw"===o.type&&(n=o.arg,O(r)),n}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:L(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=l),g}},c}(t.exports);try{regeneratorRuntime=e}catch(t){Function("r","regeneratorRuntime = r")(e)}});function xn(t,e,r,n,o,i,c){try{var a=t[i](c),u=a.value}catch(t){return void r(t)}a.done?e(u):jn.resolve(u).then(n,o)}function On(a){return function(){var t=this,c=arguments;return new jn(function(e,r){var n=a.apply(t,c);function o(t){xn(n,e,r,o,i,"next",t)}function i(t){xn(n,e,r,o,i,"throw",t)}o(void 0)})}}function Tn(t,e,r){var n=h(e);n in t?E.f(t,n,b(0,r)):t[n]=r}var Ln,An=Array.isArray||function(t){return"Array"==Z(t)},Pn=nt("species"),kn=nt("species"),Mn=nt("isConcatSpreadable"),_n=9007199254740991,In="Maximum allowed index exceeded",Rn=51<=Br||!l(function(){var t=[];return t[Mn]=!1,t.concat()[0]!==t}),Fn=(Ln="concat",51<=Br||!l(function(){var t=[];return(t.constructor={})[kn]=function(){return{foo:1}},1!==t[Ln](Boolean).foo}));et({target:"Array",proto:!0,forced:!Rn||!Fn},{concat:function(t){for(var e,r,n,o,i,c,a=rt(this),u=(r=0,An(e=a)&&("function"==typeof(n=e.constructor)&&(n===Array||An(n.prototype))||p(n)&&null===(n=n[Pn]))&&(n=void 0),new(void 0===n?Array:n)(0===r?0:r)),s=0,f=-1,l=arguments.length;f<l;f++)if(function(t){if(!p(t))return!1;var e=t[Mn];return void 0!==e?!!e:An(t)}(c=-1===f?a:arguments[f])){if(i=Rt(c.length),_n<s+i)throw TypeError(In);for(o=0;o<i;o++,s++)o in c&&Tn(u,s,c[o])}else{if(_n<=s)throw TypeError(In);Tn(u,s++,c)}return u.length=s,u}});var Nn=jt.ArrayPrototype.concat,Cn=Array.prototype,Gn=function(t){var e=t.concat;return t===Cn||t instanceof Array&&e===Cn.concat?Nn:e},Dn=window.constraints={audio:!1,video:!0};function Un(t,e){document.querySelector("#errorMsg").innerHTML+="<p>".concat(t,"</p>"),void 0!==e&&console.error(e)}function Vn(){return(Vn=On(En.mark(function t(a){var u;return En.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,navigator.mediaDevices.getUserMedia(Dn);case 3:return u=t.sent,i=void 0,i=a,c=(o=u).getVideoTracks(),console.log("Got stream with constraints:",Dn),console.log("Using video device: ".concat(c[0].label)),i.srcObject=o,t.abrupt("return",u);case 8:return t.prev=8,t.t0=t.catch(0),e=t.t0,0,"ConstraintNotSatisfiedError"===e.name?(n=Dn.video,Un(Gn(r="The resolution ".concat(n.width.exact,"x")).call(r,n.height.exact," px is not supported by your device."))):"PermissionDeniedError"===e.name&&Un("Permissions have not been granted to use your camera and microphone, you need to allow the page access to your devices in order for the demo to work."),Un("getUserMedia error: ".concat(e.name),e),t.abrupt("return",jn.reject(t.t0));case 12:case"end":return t.stop()}var e,r,n,o,i,c},t,null,[[0,8]])}))).apply(this,arguments)}function zn(o){return function(t,e){var r=2<arguments.length,n=r?Hn.call(arguments,2):void 0;return o(r?function(){("function"==typeof t?t:Function(t)).apply(this,n)}:t,e)}}var Hn=[].slice,Wn=/MSIE .\./.test(Qe);et({global:!0,bind:!0,forced:Wn},{setTimeout:zn(g.setTimeout),setInterval:zn(g.setInterval)});var qn=jt.setInterval;function Bn(t,e,r){var n=2<arguments.length&&void 0!==r?r:{},o=null,i=t.videoHeight||t.clientHeight,c=t.videoWidth||t.clientWidth,a={ondataavailable:function(){},onstop:function(){},stop:p,start:function(){t.play()}};t.addEventListener("canplay",f,!1),t.addEventListener("ended",l,!1);var u=document.createElement("canvas");function s(){var e=u.getContext("2d");e.drawImage(t,0,0,i,c),u.toBlob(function(t){a.ondataavailable(t,e)},"image/webp")}function f(){s(),o=qn(function(){s()},n.duration||200)}function l(){p(),a.onstop(),console.log("视频录制结束!")}function p(){o&&clearInterval(o),t.removeEventListener("canplay",f,!1),t.removeEventListener("ended",l,!1),u=null}return u.style.display="none",u.setAttribute("height",i),u.setAttribute("width",c),a}function Yn(t,e,r,n){var o=3<arguments.length&&void 0!==n?n:{};return"undefined"!=typeof MediaRecorder?function(t,e,r){var n,o=2<arguments.length&&void 0!==r?r:{},i=null,c=o.collectTime||1e3,a={mimeType:"video/webm;codecs=vp9"},u=null;function s(t){t.data&&0<t.data.size&&e&&e(t.data)}return i=t,n={mimeType:"video/webm;codecs=vp9"},MediaRecorder.isTypeSupported(n.mimeType)||(console.error("".concat(n.mimeType," is not Supported")),n={mimeType:"video/webm;codecs=vp8"},MediaRecorder.isTypeSupported(n.mimeType)||(console.error("".concat(n.mimeType," is not Supported")),n={mimeType:"video/webm"},MediaRecorder.isTypeSupported(n.mimeType)||(console.error("".concat(n.mimeType," is not Supported")),n={mimeType:""}))),a=n,function(){try{u=new MediaRecorder(i,a)}catch(t){return console.error("Exception while creating MediaRecorder:",t)}u.onstop=function(t){u=null,o.ended&&o.ended()},u.ondataavailable=s,u.start(c)}(),t.onended=function(){t=i=null},u}(t,r,o):Bn(e,r,o)}var Xn=null;function Zn(){var t=function(){if(Xn)return Xn;var t=document.createElement("input");return(Xn=t).setAttribute("type","file"),t.setAttribute("accept","video/*"),t.setAttribute("capture","user"),t.style.display="none",document.body.append(t),t}();return new jn(function(e){t.onchange=function(t){e(t.target.files[0])},t.click()})}var Kn={f:Object.getOwnPropertySymbols},Jn=Object.assign,Qn=Object.defineProperty,$n=!Jn||l(function(){if(y&&1!==Jn({b:1},Jn(Qn({},"a",{enumerable:!0,get:function(){Qn(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return 1;var t={},e={},r=Symbol(),n="abcdefghijklmnopqrst";return t[r]=7,n.split("").forEach(function(t){e[t]=t}),7!=Jn({},t)[r]||Yt(Jn({},e)).join("")!=n})?function(t,e){for(var r=rt(t),n=arguments.length,o=1,i=Kn.f,c=ft.f;o<n;)for(var a,u=dt(arguments[o++]),s=i?Yt(u).concat(i(u)):Yt(u),f=s.length,l=0;l<f;)a=s[l++],y&&!c.call(u,a)||(r[a]=u[a]);return r}:Jn;et({target:"Object",stat:!0,forced:Object.assign!==$n},{assign:$n});var to=jt.Object.assign,eo={width:450,height:450,duration:100,MAXTIME:15,MINSIZE:1048576},ro=window.URL||window.webkitURL;function no(){return(no=On(En.mark(function t(r,n,o){var i,c;return En.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(t.prev=0,o&&to(eo,o),e=void 0,(e=document.createElement("video")).setAttribute("width",eo.width),e.setAttribute("height",eo.height),e.style.width=eo.width,e.style.height=eo.height,e.style.visibility="hidden",e.style.position="fixed",e.style.zIndex=-99999,e.muted=!0,document.body.append(e),i=e,r.size<eo.MINSIZE)return console.info("视频小于".concat(eo.MINSIZE,", 不做处理")),n&&n(r),t.abrupt("return",r);t.next=7;break;case 7:return i.onloadedmetadata=function(){var t;if(i.duration>eo.MAXTIME)throw ro.revokeObjectURL(i.src),c.stop(),new Error(Gn(t="视频时长".concat(i.duration,"超过")).call(t,eo.MAXTIME))},t.next=10,function(r){var t=ro.createObjectURL;return t?t(r):new jn(function(t){var e=new FileReader;e.readAsDataURL(r),e.onload=function(){t(e.result)}})}(r);case 10:return i.src=t.sent,(c=Bn(i,n,o)).ondataavailable=n,c.onstop=function(){document.body.removeChild(i),i=null,eo.ended&&eo.ended()},c.start(),t.abrupt("return",c);case 18:return t.prev=18,t.t0=t.catch(0),console.error(t.t0),t.abrupt("return",jn.reject(t.t0));case 22:case"end":return t.stop()}var e},t,null,[[0,18]])}))).apply(this,arguments)}function oo(){return!!navigator.mediaDevices.getUserMedia}function io(){return co.apply(this,arguments)}function co(){return(co=On(En.mark(function t(e){var r,n;return En.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Zn();case 2:return r=t.sent,t.next=5,function(t,e,r){return no.apply(this,arguments)}(r,e.chunks,e);case 5:return n=t.sent,t.abrupt("return",n);case 7:case"end":return t.stop()}},t)}))).apply(this,arguments)}function ao(){return(ao=On(En.mark(function t(r){var n,o,i,c;return En.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(oo())return t.next=4,function(t){return Vn.apply(this,arguments)}(r.video);t.next=9;break;case 4:return n=t.sent,o=Yn(n,r.video,r.chunks,r),t.abrupt("return",{stop:function(){n.getTracks()[0].stop(),o.stop()}});case 9:if(r.degrade){t.next=11;break}return t.abrupt("return",jn.reject({isWebrtcSurport:!1}));case 11:if(!0===r.degrade)return t.abrupt("return",io(r));t.next=13;break;case 13:if(r.degrade)return i=null,c=new jn(function(t){return i=t}),("string"==typeof(e=r.degrade)?document.querySelector(e):e).addEventListener("click",function(){io(r).then(i)}),t.abrupt("return",c);t.next=18;break;case 18:case"end":return t.stop()}var e},t)}))).apply(this,arguments)}t.openVideo=function(t){return ao.apply(this,arguments)},t.webrtcSurport=oo,Object.defineProperty(t,"__esModule",{value:!0})});