red5pro-webrtc-sdk
Version:
Red5 Pro HTML SDK
33 lines • 376 kB
JavaScript
/*!
*
* red5pro-sdk - Red5 Pro HTML Publisher and Subscriber SDK.
* Author: Infrared5 Inc.
* Version: 14.0.0-release.b172
* Url: https://github.com/red5pro/red5pro-html-sdk#readme
*
* Copyright © 2015 Infrared5, Inc. All rights reserved.
*
* The accompanying code comprising examples for use solely in conjunction with Red5 Pro (the "Example Code")
* is licensed to you by Infrared5 Inc. in consideration of your agreement to the following
* license terms and conditions. Access, use, modification, or redistribution of the accompanying
* code constitutes your acceptance of the following license terms and conditions.
*
* Permission is hereby granted, free of charge, to you to use the Example Code and associated documentation
* files (collectively, the "Software") without restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
* persons to whom the Software is furnished to do so, subject to the following conditions:
*
* The Software shall be used solely in conjunction with Red5 Pro. Red5 Pro is licensed under a separate end
* user license agreement (the "EULA"), which must be executed with Infrared5, Inc.
* An example of the EULA can be found on our website at: https://account.red5.net/assets/LICENSE.txt.
*
* The above copyright notice and this license shall be included in all copies or portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
* NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL INFRARED5, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
*/
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.red5prosdk=t():e.red5prosdk=t()}(window,(function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=1)}([function(e,t,n){"use strict";function r(e){if(null==e)return e;if(Array.isArray(e))return e.slice();if("object"==typeof e){var t={};return Object.keys(e).forEach((function(n){t[n]=e[n]})),t}return e}var o=function(e){if(null===e)return"null";if("string"!=typeof e)return e.toString();for(var t=/%[sdj%]/g,n=1,r=arguments,o=r.length,i=String(e).replace(t,(function(e){if("%%"===e)return"%";if(n>=o)return e;switch(e){case"%s":return String(r[n++]);case"%d":return Number(r[n++]);case"%j":try{return JSON.stringify(r[n++])}catch(e){return"[Circular]"}break;default:return e}})),a=r[n];n<o;a=r[++n])i+=" "+a;return i};function i(){var e={},t=Error.stackTraceLimit,n=Error.prepareStackTrace;return Error.stackTraceLimit=3,Error.prepareStackTrace=function(t,n){var r=n[2];e.file=r.getFileName(),e.line=r.getLineNumber();var o=r.getFunctionName();o&&(e.func=o)},Error.stackTraceLimit=t,Error.prepareStackTrace=n,e}function a(e,t){if(t){if(c[t])return;c[t]=!0}console.error(e+"\n")}function s(e){return c[e]}var c={};function u(){}function l(){}u.prototype.write=function(e){e.level<h?console.log(e):e.level<f?console.info(e):e.level<p?console.warn(e):console.error(e),e.err&&e.err.stack&&console.error(e.err.stack)},l.prototype.write=function(e){var t;t=e.level<d?"color: DeepPink":e.level<h?"color: GoldenRod":e.level<f?"color: DarkTurquoise":e.level<p?"color: Purple":e.level<v?"color: Crimson":"color: Black";var n=e.childName?e.name+"/"+e.childName:e.name,r=y[e.level].toUpperCase();function o(e,t){return Array(t+1-(e+"").length).join("0")+e}r=Array(6-r.length).join(" ")+r,console.log("[%s:%s:%s:%s] %c%s%c: %s: %c%s",o(e.time.getHours(),2),o(e.time.getMinutes(),2),o(e.time.getSeconds(),2),o(e.time.getMilliseconds(),4),t,r,"color: DimGray",n,"color: SteelBlue",e.msg),e.err&&e.err.stack&&console.log("%c%s,",t,e.err.stack)};var d=20,h=30,f=40,p=50,v=60,m={trace:10,debug:d,info:h,warn:f,error:p,fatal:v},y={};function b(e){return"string"==typeof e?m[e.toLowerCase()]:e}function g(e,t,n){if(!(this instanceof g))return new g(e,t);var o,i,a,s;if(void 0!==t&&(o=e,e=t,!(o instanceof g)))throw new TypeError("invalid Logger creation: do not pass a second arg");if(!e)throw new TypeError("options (object) is required");if(o){if(e.name)throw new TypeError("invalid options.name: child cannot set logger name")}else if(!e.name)throw new TypeError("options.name (string) is required");if(e.stream&&e.streams)throw new TypeError('cannot mix "streams" and "stream" options');if(e.streams&&!Array.isArray(e.streams))throw new TypeError("invalid options.streams: must be an array");if(e.serializers&&("object"!=typeof e.serializers||Array.isArray(e.serializers)))throw new TypeError("invalid options.serializers: must be an object");if(o&&n){this._isSimpleChild=!0,this._level=o._level,this.streams=o.streams,this.serializers=o.serializers,this.src=o.src,i=this.fields={};var c=Object.keys(o.fields);for(s=0;s<c.length;s++)a=c[s],i[a]=o.fields[a];var l=Object.keys(e);for(s=0;s<l.length;s++)a=l[s],i[a]=e[a]}else{var d=this;if(o){for(this._level=o._level,this.streams=[],s=0;s<o.streams.length;s++){var h=r(o.streams[s]);h.closeOnExit=!1,this.streams.push(h)}this.serializers=r(o.serializers),this.src=o.src,this.fields=r(o.fields),e.level&&this.level(e.level)}else this._level=Number.POSITIVE_INFINITY,this.streams=[],this.serializers=null,this.src=!1,this.fields={};e.stream?d.addStream({type:"stream",stream:e.stream,closeOnExit:!1,level:e.level}):e.streams?e.streams.forEach((function(t){d.addStream(t,e.level)})):o&&e.level?this.level(e.level):o||d.addStream({type:"raw",stream:new u,closeOnExit:!1,level:e.level}),e.serializers&&d.addSerializers(e.serializers),e.src&&(this.src=!0),delete(i=r(e)).stream,delete i.level,delete i.streams,delete i.serializers,delete i.src,this.serializers&&this._applySerializers(i),Object.keys(i).forEach((function(e){d.fields[e]=i[e]}))}}function _(e){return function(){var t=this;function n(n){var a;n[0]instanceof Error?(c={err:t.serializers&&t.serializers.err?t.serializers.err(n[0]):g.stdSerializers.err(n[0])},a={err:!0},u=1===n.length?[c.err.message]:Array.prototype.slice.call(n,1)):"object"!=typeof n[0]&&null!==n[0]||Array.isArray(n[0])?(c=null,u=Array.prototype.slice.call(n)):(c=n[0],u=Array.prototype.slice.call(n,1));var s=r(t.fields);s.level=e;var l=c?r(c):null;return l&&(t.serializers&&t._applySerializers(l,a),Object.keys(l).forEach((function(e){s[e]=l[e]}))),s.levelName=y[e],s.msg=o.apply(t,u),s.time||(s.time=new Date),t.src&&!s.src&&(s.src=i()),s.v=0,s}var c=null,u=arguments,l=null;if(this._emit){if(0===arguments.length)return this._level<=e;this._level>e||(l=n(u),this._emit(l))}else{var d="unbound";if(!s[d]){var h=i();a(o("bunyan usage error: %s:%s: attempt to log with an unbound log method: `this` is: %s",h.file,h.line,this.toString()),d)}}}}function w(e){var t=e.stack||e.toString();if(e.cause&&"function"==typeof e.cause){var n=e.cause();n&&(t+="\nCaused by: "+w(n))}return t}function S(){var e=[];return function(t,n){return n&&"object"==typeof n?-1!==e.indexOf(n)?"[Circular]":(e.push(n),n):n}}Object.keys(m).forEach((function(e){y[m[e]]=e})),g.prototype.addStream=function(e,t){switch(null==t&&(t=h),!(e=r(e)).type&&e.stream&&(e.type="raw"),e.raw="raw"===e.type,e.level?e.level=b(e.level):e.level=b(t),e.level<this._level&&(this._level=e.level),e.type){case"stream":case"raw":e.closeOnExit||(e.closeOnExit=!1);break;default:throw new TypeError('unknown stream type "'+e.type+'"')}this.streams.push(e),delete this.haveNonRawStreams},g.prototype.addSerializers=function(e){var t=this;t.serializers||(t.serializers={}),Object.keys(e).forEach((function(n){var r=e[n];if("function"!=typeof r)throw new TypeError(o('invalid serializer for "%s" field: must be a function',n));t.serializers[n]=r}))},g.prototype.child=function(e,t){return new this.constructor(this,e||{},t)},g.prototype.level=function(e){if(void 0===e)return this._level;for(var t=b(e),n=this.streams.length,r=0;r<n;r++)this.streams[r].level=t;this._level=t},g.prototype.levels=function(e,t){if(void 0===e)return this.streams.map((function(e){return e.level}));var n;if("number"==typeof e){if(void 0===(n=this.streams[e]))throw new Error("invalid stream index: "+e)}else{for(var r=this.streams.length,i=0;i<r;i++){var a=this.streams[i];if(a.name===e){n=a;break}}if(!n)throw new Error(o('no stream with name "%s"',e))}if(void 0===t)return n.level;var s=b(t);n.level=s,s<this._level&&(this._level=s)},g.prototype._applySerializers=function(e,t){var n=this;Object.keys(this.serializers).forEach((function(r){if(!(void 0===e[r]||t&&t[r]))try{e[r]=n.serializers[r](e[r])}catch(t){a(o('bunyan: ERROR: Exception thrown from the "%s" Bunyan serializer. This should never happen. This is a bugin that serializer function.\n%s',r,t.stack||t)),e[r]=o('(Error in Bunyan log "%s" serializer broke field. See stderr for details.)',r)}}))},g.prototype._emit=function(e,t){var n,r;if(void 0===this.haveNonRawStreams)for(this.haveNonRawStreams=!1,n=0;n<this.streams.length;n++)if(!this.streams[n].raw){this.haveNonRawStreams=!0;break}if(t||this.haveNonRawStreams)try{r=JSON.stringify(e,S())+"\n"}catch(t){var i=t.stack.split(/\n/g,2).join("\n");a('bunyan: ERROR: Exception in `JSON.stringify(rec)`. You can install the "safe-json-stringify" module to have Bunyan fallback to safer stringification. Record:\n'+function(e,t){return t||(t=" "),t+e.split(/\r?\n/g).join("\n"+t)}(o("%s\n%s",e,t.stack)),i),r=o("(Exception in JSON.stringify(rec): %j. See stderr for details.)\n",t.message)}if(t)return r;var s=e.level;for(n=0;n<this.streams.length;n++){var c=this.streams[n];c.level<=s&&c.stream.write(c.raw?e:r)}return r},g.prototype.trace=_(10),g.prototype.debug=_(d),g.prototype.info=_(h),g.prototype.warn=_(f),g.prototype.error=_(p),g.prototype.fatal=_(v),g.stdSerializers={},g.stdSerializers.err=function(e){return e&&e.stack?{message:e.message,name:e.name,stack:w(e),code:e.code,signal:e.signal}:e},e.exports=g,e.exports.TRACE=10,e.exports.DEBUG=d,e.exports.INFO=h,e.exports.WARN=f,e.exports.ERROR=p,e.exports.FATAL=v,e.exports.resolveLevel=b,e.exports.levelFromName=m,e.exports.nameFromLevel=y,e.exports.VERSION="0.2.3",e.exports.LOG_VERSION=0,e.exports.createLogger=function(e){return new g(e)},e.exports.safeCycles=S,e.exports.ConsoleFormattedStream=l,e.exports.ConsoleRawStream=u},function(e,t,n){e.exports=n(2)},function(e,t,n){"use strict";n.r(t),n.d(t,"RTCConferenceParticipant",(function(){return vc})),n.d(t,"Red5ProSubscriber",(function(){return mc})),n.d(t,"RTCSubscriber",(function(){return yc})),n.d(t,"WHEPClient",(function(){return bc})),n.d(t,"RTMPSubscriber",(function(){return gc})),n.d(t,"HLSSubscriber",(function(){return _c})),n.d(t,"PlaybackView",(function(){return Kr})),n.d(t,"Red5ProPublisher",(function(){return wc})),n.d(t,"RTCPublisher",(function(){return Sc})),n.d(t,"WHIPClient",(function(){return Ec})),n.d(t,"RTMPPublisher",(function(){return Cc})),n.d(t,"PublisherView",(function(){return va})),n.d(t,"PlaybackControls",(function(){return jn})),n.d(t,"PublisherEventTypes",(function(){return kc})),n.d(t,"RTCPublisherEventTypes",(function(){return Pc})),n.d(t,"FailoverPublisherEventTypes",(function(){return Oc})),n.d(t,"SubscriberEventTypes",(function(){return Tc})),n.d(t,"RTCSubscriberEventTypes",(function(){return Rc})),n.d(t,"RTMPSubscriberEventTypes",(function(){return Lc})),n.d(t,"FailoverSubscriberEventTypes",(function(){return Ac})),n.d(t,"MessageTransportStateEventTypes",(function(){return Nc})),n.d(t,"RTCConferenceParticipantEventType",(function(){return jc})),n.d(t,"PlaybackAudioEncoder",(function(){return Hc})),n.d(t,"PlaybackVideoEncoder",(function(){return Ic})),n.d(t,"PublishAudioEncoder",(function(){return xc})),n.d(t,"PublishVideoEncoder",(function(){return Dc})),n.d(t,"IceTransportTypes",(function(){return Mc})),n.d(t,"TransformFrameTypes",(function(){return Fc})),n.d(t,"setLogLevel",(function(){return Uc})),n.d(t,"getRecordedLogs",(function(){return f})),n.d(t,"LOG_LEVELS",(function(){return Bc})),n.d(t,"getLogger",(function(){return Vc}));var r=n(0);function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,a(r.key),r)}}function a(e){var t=function(e,t){if("object"!=o(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=o(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==o(t)?t:t+""}var s,c,u=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},(t=[{key:"write",value:function(e){console.log("%s - [%s] %s: %s",e.time.toISOString(),e.name,r.nameFromLevel[e.level],e.msg)}}])&&i(e.prototype,t),n&&i(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n}(),l=function(e){return function(t,n){var r;s[e]((r=t,function(e){return"(".concat(r,") ").concat(e)})(n))}},d={TRACE:"trace",INFO:"info",DEBUG:"debug",WARN:"warn",ERROR:"error",FATAL:"fatal"},h=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0,o=[];if(o.push({level:e,stream:new u,type:"raw"}),n){var i=n.map((function(t){t.level=e}));o=o.concat(i)}t&&(c=[],o.push({level:e,stream:{write:function(e){var t="[".concat(e.time.toISOString(),"] ").concat(r.nameFromLevel[e.level],": ").concat(e.msg);c.push(t)}}})),s=Object(r.createLogger)({level:e,name:"red5pro-sdk",streams:o})},f=function(){return c},p=(l(d.TRACE),l(d.INFO)),v=l(d.DEBUG),m=l(d.WARN),y=l(d.ERROR);l(d.FATAL);function b(e){return(b="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function g(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,w(r.key),r)}}function _(e,t,n){return t&&g(e.prototype,t),n&&g(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function w(e){var t=function(e,t){if("object"!=b(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=b(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==b(t)?t:t+""}var S=_((function e(){var t=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.resolve=void 0,this.reject=void 0,this.promise=new Promise((function(e,n){t.resolve=e,t.reject=n}))})),E={createIfNotExist:function(e){var t=e;return t||(t=new S),t}},C=S,k=E;function P(e){return(P="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function O(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],c=!0,u=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){u=!0,o=e}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return T(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?T(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function T(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function R(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */R=function(){return t};var e,t={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(e,t,n){e[t]=n.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function u(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{u({},"")}catch(e){u=function(e,t,n){return e[t]=n}}function l(e,t,n,r){var i=t&&t.prototype instanceof m?t:m,a=Object.create(i.prototype),s=new A(r||[]);return o(a,"_invoke",{value:k(e,n,s)}),a}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=l;var h="suspendedStart",f="executing",p="completed",v={};function m(){}function y(){}function b(){}var g={};u(g,a,(function(){return this}));var _=Object.getPrototypeOf,w=_&&_(_(N([])));w&&w!==n&&r.call(w,a)&&(g=w);var S=b.prototype=m.prototype=Object.create(g);function E(e){["next","throw","return"].forEach((function(t){u(e,t,(function(e){return this._invoke(t,e)}))}))}function C(e,t){function n(o,i,a,s){var c=d(e[o],e,i);if("throw"!==c.type){var u=c.arg,l=u.value;return l&&"object"==P(l)&&r.call(l,"__await")?t.resolve(l.__await).then((function(e){n("next",e,a,s)}),(function(e){n("throw",e,a,s)})):t.resolve(l).then((function(e){u.value=e,a(u)}),(function(e){return n("throw",e,a,s)}))}s(c.arg)}var i;o(this,"_invoke",{value:function(e,r){function o(){return new t((function(t,o){n(e,r,t,o)}))}return i=i?i.then(o,o):o()}})}function k(t,n,r){var o=h;return function(i,a){if(o===f)throw Error("Generator is already running");if(o===p){if("throw"===i)throw a;return{value:e,done:!0}}for(r.method=i,r.arg=a;;){var s=r.delegate;if(s){var c=O(s,r);if(c){if(c===v)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===h)throw o=p,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=f;var u=d(t,n,r);if("normal"===u.type){if(o=r.done?p:"suspendedYield",u.arg===v)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(o=p,r.method="throw",r.arg=u.arg)}}}function O(t,n){var r=n.method,o=t.iterator[r];if(o===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,O(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),v;var i=d(o,t.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,v;var a=i.arg;return a?a.done?(n[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,v):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function T(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function L(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function A(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(T,this),this.reset(!0)}function N(t){if(t||""===t){var n=t[a];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function n(){for(;++o<t.length;)if(r.call(t,o))return n.value=t[o],n.done=!1,n;return n.value=e,n.done=!0,n};return i.next=i}}throw new TypeError(P(t)+" is not iterable")}return y.prototype=b,o(S,"constructor",{value:b,configurable:!0}),o(b,"constructor",{value:y,configurable:!0}),y.displayName=u(b,c,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===y||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,b):(e.__proto__=b,u(e,c,"GeneratorFunction")),e.prototype=Object.create(S),e},t.awrap=function(e){return{__await:e}},E(C.prototype),u(C.prototype,s,(function(){return this})),t.AsyncIterator=C,t.async=function(e,n,r,o,i){void 0===i&&(i=Promise);var a=new C(l(e,n,r,o),i);return t.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},E(S),u(S,c,"Generator"),u(S,a,(function(){return this})),u(S,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},t.values=N,A.prototype={constructor:A,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(L),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function o(r,o){return s.type="throw",s.arg=t,n.next=r,o&&(n.method="next",n.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=r.call(a,"catchLoc"),u=r.call(a,"finallyLoc");if(c&&u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),v},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),L(n),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;L(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:N(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),v}},t}function L(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,A(r.key),r)}}function A(e){var t=function(e,t){if("object"!=P(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=P(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==P(t)?t:t+""}var N=new WeakMap,j=function(e){return N.has(e)||N.set(e,{}),N.get(e)},H=function(){return e=function e(){var t=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.listorder=R().mark((function e(t){return R().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(t.length>0)){e.next=5;break}return e.next=3,t.shift();case 3:e.next=0;break;case 5:case"end":return e.stop()}}),e)})),j(this).find=function(e,n,r,o){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null,s=j(t).next(e,n),c=O(s,2),u=c[0],l=c[1];if(l){var d=r[u];d=d||r,(i?(new l)[i](d):new l(d)).then((function(e){o.resolve(e)})).catch((function(s){a=s,j(t).find(e,n,r,o,i,a)}))}else o.reject(a)},j(this).next=function(e,t){var n,r,o=e.next();return o.done||(r=o.value,n=t.get(r)),[r,n]}},(t=[{key:"create",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,o=new C;return j(this).find(this.listorder(e.slice()),t,n,o,r),o.promise}}])&&L(e.prototype,t),n&&L(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n}();function I(e){return(I="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function x(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,D(r.key),r)}}function D(e){var t=function(e,t){if("object"!=I(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=I(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==I(t)?t:t+""}var M=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._callbacks={},this._callbacks.RED5PRO=[]},(t=[{key:"_notify",value:function(e,t){var n,r=e.length;for(n=0;n<r;n++)e[n](t)}},{key:"on",value:function(e,t){"function"==typeof t&&("*"!==e?(void 0===this._callbacks[e]&&(this._callbacks[e]=[]),-1===this._callbacks[e].indexOf(t)&&this._callbacks[e].push(t)):this._callbacks.RED5PRO.push(t))}},{key:"off",value:function(e,t){var n=this._callbacks[e];if("*"===e&&(n=this._callbacks.RED5PRO),n){var r=n.indexOf(t);-1!==r&&n.splice(r,1)}}},{key:"trigger",value:function(e){var t=e.type;this._callbacks[t]&&this._notify(this._callbacks[t],e),this._notify(this._callbacks.RED5PRO,e)}}])&&x(e.prototype,t),n&&x(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n}();function F(e){return(F="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function U(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,V(r.key),r)}}function B(e,t,n){return t&&U(e.prototype,t),n&&U(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function V(e){var t=function(e,t){if("object"!=F(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=F(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==F(t)?t:t+""}function G(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var W=B((function e(t){G(this,e),this.name="NoElementFound",this.message=t})),Y=B((function e(t){G(this,e),this.name="InvalidNameError",this.message=t})),z=/['"](.*?)['"]:/gi,K=/:['"](.*?)['"]/gi,J=new WeakMap;function q(e,t){try{return JSON.parse(e)[t]}catch(o){var n,r=z.exec(e);return r&&r.length>1&&(n=K.exec(e),r[1]===t&&n&&n.length>1)?n[1]:void 0}}var X=function(e){var t="function"==typeof e.textTracks?e.textTracks():e.textTracks;t&&(e.addTextTrack("metadata"),t.addEventListener("addtrack",(function(t){var n=t.track;n.mode="hidden",n.addEventListener("cuechange",(function(t){var r,o;r=(r=t&&t.currentTarget?t.currentTarget.cues:(r=n.cues)&&r.length>0?r:n.activeCues)||[];var i=function(){var t=r[o];if(t.value){var n="string"==typeof t.value.data?t.value.data:function(e,t,n){var r="",o=t,i=t+n;do{r+=String.fromCharCode(e[o++])}while(o<i);return r}(t.value.data,0,t.size),i=function(e){var t=q(e,"orientation");if(t)return{orientation:parseInt(t)}}(n),a=function(e){var t=q(e,"streamingMode");if(t)return{streamingMode:t}}(n),s=function(e){return J.get(e)}(e);i&&s&&s.orientation&&s.orientation.forEach((function(e){e(i)})),a&&s&&s.streamingMode&&s.streamingMode.forEach((function(e){e(a)}))}};for(o=0;o<r.length;o++)i()}))})))};function $(e){return($="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var Q=[],Z=[],ee=!1;var te=[];function ne(e){var t,n=screen.orientation?screen.orientation.angle:void 0,r=void 0===n?window.matchMedia("(orientation: portrait)").matches?0:90:n,o=te.length;for(v("[window:onorientationchange]","orientation(".concat(r,").")),t=0;t<o;t++)te[t]((r+90)%360)}var re=[],oe=!1;function ie(e){var t,n=re.length;for(t=0;t<n;t++)re[t]();oe=!0}var ae=function(){var e="0,0,0";try{e=new window.ActiveXObject("ShockwaveFlash.ShockwaveFlash").GetVariable("$version").replace(/\D+/g,",").match(/^,?(.+),?$/)[1]}catch(t){try{navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin&&(e=(navigator.plugins["Shockwave Flash 2.0"]||navigator.plugins["Shockwave Flash"]).description.replace(/\D+/g,",").match(/^,?(.+),?$/)[1])}catch(e){}}return e.split(",")},se=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||function(e){return window.setTimeout(e,1e3)},ce=function(){var e=document.createElement("video");return e.canPlayType("application/vnd.apple.mpegURL").length>0||e.canPlayType("application/x-mpegURL").length>0||e.canPlayType("audio/mpegurl").length>0||e.canPlayType("audio/x-mpegurl").length>0},ue=window.adapter,le=!!navigator.mozGetUserMedia,de=!!document.documentMode,he=ue?"edge"===window.adapter.browserDetails.browser.toLowerCase():!de&&!!window.StyleMedia,fe=ue?"safari"===window.adapter.browserDetails.browser.toLowerCase():ce(),pe="ontouchstart"in window||window.DocumentTouch&&window.document instanceof window.DocumentTouch;ue||(navigator.getUserMedia=navigator.mediaDevices&&navigator.mediaDevices.getUserMedia||navigator.getUserMedia||navigator.mozGetUserMedia||navigator.webkitGetUserMedia||navigator.msGetUserMedia);var ve={requestFrame:se,getIsMoz:function(){return le},getIsEdge:function(){return he},getIsPossiblySafari:function(){return fe},isTouchEnabled:function(){return pe},supportsWebSocket:function(){return!!window.WebSocket},supportsHLS:ce,supportsNonNativeHLS:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;if(e)try{return e.isSupported()}catch(e){return m("Could not access Hls.js."),!1}return!!window.Hls&&window.Hls.isSupported()},createHLSClient:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new window.Hls(e)},getHLSClientEventEnum:function(){return window.Hls.Events},supportsFlashVersion:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:".";return ae()[0]>=e.split(t)[0]},resolveElement:function(e){try{var t=document.getElementById(e);if(!t)throw new W("Element with id(".concat(e,") could not be found."));return t}catch(t){throw new W("Error in accessing element with id(".concat(e,"). ").concat(t.message))}},createWebSocket:function(e){return new WebSocket(e)},setVideoSource:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];try{e.srcObject=t}catch(n){m("[setVideoSource:obj]","Could not set srcObject: ".concat(n.message)),le?e.mozSrcObject=t:e.src=window.URL.createObjectURL(t)}if(n)try{var r=e.play();r&&r.then((function(){return v("[setVideoSource:action]","play (START)")})).catch((function(e){return m("[setVideoSource:action]","play (FAULT) "+(e.message?e.message:e))}))}catch(t){m("[setVideoSource:action]","play (CATCH::FAULT) "+t.message);try{e.setAttribute("autoplay",!1),e.pause()}catch(e){m("[setVideoSource:action]","pause (CATCH::FAULT) "+e.message)}}else try{e.setAttribute("autoplay",!1),e.pause()}catch(e){}},injectScript:function(e){var t=new C,n=document.createElement("script");return n.type="text/javascript",n.onload=function(){t.resolve()},n.onreadystatechange=function(){"loaded"!==n.readyState&&"complete"!==n.readyState||(n.onreadystatechange=null,t.resolve())},n.src=e,document.getElementsByTagName("head")[0].appendChild(n),t.promise},gUM:function(e){return(navigator.mediaDevices||navigator).getUserMedia(e)},setGlobal:function(e,t){window[e]=t},getSwfObject:function(){return window.swfobject},getEmbedObject:function(e){return document.getElementById(e)},getElementId:function(e){return e.getAttribute("id")},addOrientationChangeHandler:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n="onorientationchange"in window;n&&(v("[window:orientation]","[addOrientationChangeHandler]","adding responder."),te.push(e),t&&ne()),1===te.length&&(v("[window:orientation]","[addOrientationChangeHandler]","onorientationchange added."),window.addEventListener("orientationchange",ne))},removeOrientationChangeHandler:function(e){for(var t=te.length;--t>-1;)if(te[t]===e){te.slice(t,1);break}0===te.length&&(v("[window:orientation]","[removeOrientationChangeHandler]:: onorientationchange removed."),window.removeEventListener("onorientationchange",ne))},addCloseHandler:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1;re.splice(-1===t?re.length:t,0,e),oe||window.addEventListener("unload",ie)},removeCloseHandler:function(e){for(var t=re.length;--t>-1;)if(re[t]===e){re.slice(t,1);break}},invoke:function(e,t){window.hasOwnProperty(e)&&window[e].call(window,t)},toggleFullScreen:function(e){window.screenfull&&window.screenfull.enabled&&window.screenfull.toggle(e)},onFullScreenStateChange:function(e){Z.push(e),window.screenfull,!ee&&window.screenfull&&window.screenfull.enabled&&(ee=!0,window.screenfull.onchange((function(){var e,t=Z.length;for(e=0;e<t;e++)Z[e](window.screenfull.isFullscreen)})))},onOrientationMetadata:function(e,t){var n=J.get(e);J.has(e)?n.hasOwnProperty("orientation")||(J.get(e).orientation=[]):(X(e),J.set(e,{orientation:[]})),J.get(e).orientation.push(t)},onStreamingModeMetadata:function(e,t){var n=J.get(e);J.has(e)?n.hasOwnProperty("streamingMode")||(J.get(e).streamingMode=[]):(X(e),J.set(e,{streamingMode:[]})),J.get(e).streamingMode.push(t)},hasAttributeDefined:function(e,t){var n=e.getAttribute(t);return null!==n&&void 0!==$(n)&&"string"==typeof n&&(""===n||"true"===n||n===t)},hasClassDefined:function(e,t){return e.classList.contains(t)},createElement:function(e,t){return"text"===e?document.createTextNode(t.toString()):document.createElement(e,t)},addSubscriptionAssignmentHandler:function(e){Q.push(e),void 0===window.setSubscriberId&&(window.setSubscriberId=function(e){Q.shift()(e)})},getMouseXFromEvent:function(e){return e||(e=window.event),e.pageX?e.pageX:e.clientX?e.clientX+document.body.scrollLeft+document.documentElement.scrollLeft:0},getScrollX:function(){return void 0!==window.pageXOffset?window.pageXOffset:(document.documentElement||document.body.parentNode||document.body).scrollLeft},createEvent:function(e){return document.createEvent(e)},getGlobal:function(){return window}},me=ve.requestFrame,ye=["webkitTransformOrigin","mozTransformOrigin","msTransformOrigin","oTransformOrigin","transformOrigin"],be=["webkitTransform","mozTransform","msTransform","oTransform","transform"],ge=["webkitTransition","mozTransition","msTransition","oTransition","transition"],_e={0:{origin:"center center",transform:"rotate(0deg)"},90:{origin:"left top",transform:"rotate(90deg) translateY(-100%)"},180:{origin:"center center",transform:"rotate(180deg)"},270:{origin:"top left",transform:"rotate(270deg) translateX(-100%) translateY(0%)"},"-90":{origin:"left top",transform:"rotate(-90deg) translateX(-100%)"},"-180":{origin:"center center",transform:"rotate(-180deg)"},"-270":{origin:"top left",transform:"rotate(-270deg) translateY(-100%)"}},we=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return function(){var r=e.parentNode;if(r){var o=r.clientWidth,i=r.clientHeight;e.style.width=n?i+"px":o+"px";var a=e.clientWidth,s=e.clientHeight,c=.5*(n?o-s:o-a);e.style.position="relative",e.style.left=c+"px"}t&&t(we(e,t,n))}},Se=function(e,t,n){var r,o=be.length,i=(t%=360)%180!=0,a=e.parentNode,s=e.width?e.width:a.clientWidth,c=e.height?e.height:a.clientHeight,u=_e[t.toString()];for(r=0;r<o;r++)e.style[ye[r]]=u.origin,e.style[be[r]]=u.transform,e.style[ge[r]]="transform 0.0s linear";i?(e.style.width=c+"px",a.style.height=c+"px"):(e.style.width=s+"px",e.style.height=c+"px",a.style.height="unset"),document.attachEvent?a.attachEvent("resize",we(e,me,i)):we(e,me,i)()},Ee=function(e){var t=e.length;return function n(){var r=Array.prototype.slice.call(arguments,0);return r.length>=t?e.apply(null,r):function(){var e=Array.prototype.slice.call(arguments,0);return n.apply(null,r.concat(e))}}},Ce=Ee((function(e,t){for(var n=0,r=t.length,o=[];n<r;)e(t[n])&&(o[o.length]=t[n]),n+=1;return o})),ke=function(e){return"string"==typeof e?parseInt(e,10):Math.round(e)},Pe=function(e){var t=JSON.stringify(e);return JSON.parse(t)},Oe=function(e){if("string"==typeof e){var t=e.split(",");return{width:parseInt(t[0]),height:parseInt(t[1])}}return e},Te=function(e){return 0===Object.keys(e).length&&e.constructor===Object};function Re(e){return(Re="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Le(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */Le=function(){return t};var e,t={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(e,t,n){e[t]=n.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function u(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{u({},"")}catch(e){u=function(e,t,n){return e[t]=n}}function l(e,t,n,r){var i=t&&t.prototype instanceof m?t:m,a=Object.create(i.prototype),s=new R(r||[]);return o(a,"_invoke",{value:k(e,n,s)}),a}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=l;var h="suspendedStart",f="executing",p="completed",v={};function m(){}function y(){}function b(){}var g={};u(g,a,(function(){return this}));var _=Object.getPrototypeOf,w=_&&_(_(L([])));w&&w!==n&&r.call(w,a)&&(g=w);var S=b.prototype=m.prototype=Object.create(g);function E(e){["next","throw","return"].forEach((function(t){u(e,t,(function(e){return this._invoke(t,e)}))}))}function C(e,t){function n(o,i,a,s){var c=d(e[o],e,i);if("throw"!==c.type){var u=c.arg,l=u.value;return l&&"object"==Re(l)&&r.call(l,"__await")?t.resolve(l.__await).then((function(e){n("next",e,a,s)}),(function(e){n("throw",e,a,s)})):t.resolve(l).then((function(e){u.value=e,a(u)}),(function(e){return n("throw",e,a,s)}))}s(c.arg)}var i;o(this,"_invoke",{value:function(e,r){function o(){return new t((function(t,o){n(e,r,t,o)}))}return i=i?i.then(o,o):o()}})}function k(t,n,r){var o=h;return function(i,a){if(o===f)throw Error("Generator is already running");if(o===p){if("throw"===i)throw a;return{value:e,done:!0}}for(r.method=i,r.arg=a;;){var s=r.delegate;if(s){var c=P(s,r);if(c){if(c===v)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===h)throw o=p,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=f;var u=d(t,n,r);if("normal"===u.type){if(o=r.done?p:"suspendedYield",u.arg===v)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(o=p,r.method="throw",r.arg=u.arg)}}}function P(t,n){var r=n.method,o=t.iterator[r];if(o===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,P(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),v;var i=d(o,t.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,v;var a=i.arg;return a?a.done?(n[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,v):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function O(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function T(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function R(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(O,this),this.reset(!0)}function L(t){if(t||""===t){var n=t[a];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function n(){for(;++o<t.length;)if(r.call(t,o))return n.value=t[o],n.done=!1,n;return n.value=e,n.done=!0,n};return i.next=i}}throw new TypeError(Re(t)+" is not iterable")}return y.prototype=b,o(S,"constructor",{value:b,configurable:!0}),o(b,"constructor",{value:y,configurable:!0}),y.displayName=u(b,c,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===y||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,b):(e.__proto__=b,u(e,c,"GeneratorFunction")),e.prototype=Object.create(S),e},t.awrap=function(e){return{__await:e}},E(C.prototype),u(C.prototype,s,(function(){return this})),t.AsyncIterator=C,t.async=function(e,n,r,o,i){void 0===i&&(i=Promise);var a=new C(l(e,n,r,o),i);return t.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},E(S),u(S,c,"Generator"),u(S,a,(function(){return this})),u(S,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},t.values=L,R.prototype={constructor:R,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(T),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function o(r,o){return s.type="throw",s.arg=t,n.next=r,o&&(n.method="next",n.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=r.call(a,"catchLoc"),u=r.call(a,"finallyLoc");if(c&&u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),v},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),T(n),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;T(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:L(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),v}},t}function Ae(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,o)}function Ne(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Ae(i,r,o,a,s,"next",e)}function s(e){Ae(i,r,o,a,s,"throw",e)}a(void 0)}))}}var je,He=[{label:"4K(UHD)",width:3840,height:2160},{label:"1080p(FHD)",width:1920,height:1080},{label:"UXGA",width:1600,height:1200},{label:"720p(HD)",width:1280,height:720},{label:"SVGA",width:800,height:600},{label:"VGA",width:640,height:480},{label:"360p(nHD)",width:640,height:360},{label:"CIF",width:352,height:288},{label:"QVGA",width:320,height:240},{label:"QCIF",width:176,height:144},{label:"QQVGA",width:160,height:120}],Ie=function(e){return e.exact||e.ideal||e.max||e.min||e},xe=Ee((function(e,t){if("boolean"==typeof e.video)return!0;var n=e.video.hasOwnProperty("width")?Ie(e.video.width):0,r=e.video.hasOwnProperty("height")?Ie(e.video.height):0,o=n===t.width&&r===t.height;return o&&v("[gum:isExact]","Found matching resolution for ".concat(t.width,", ").concat(t.height,".")),o})),De=Ee((function(e,t){var n=(e.video.hasOwnProperty("width")?Ie(e.video.width):0)*(e.video.hasOwnProperty("height")?Ie(e.video.height):0);return t.width*t.height<n})),Me=Ee((function(e,t){var n=Ce(xe(t))(e);return v("[gum:hasMatchingFormat]","Filtered list: "+JSON.stringify(n,null,2)),n.length>0})),Fe=Ee((function(e,t){var n=De(t);return Ce(n)(e)})),Ue=function(e,t,n){if(0!=t.length){var r=t.shift();e.video.width={exact:r.width},e.video.height={exact:r.height},ve.gUM(e).then((function(t){n.resolve({media:t,constraints:e})})).catch((function(r){var o="string"==typeof r?r:[r.name,r.message].join(": ");v("[gum:getUserMedia]","Failure in getUserMedia: ".concat(o,". Attempting other resolution tests...")),v("[gUM:findformat]","Constraints declined by browser: ".concat(JSON.stringify(e,null,2))),Ue(e,t,n)}))}else!function(e,t){e.video=!0,ve.gUM(e).then((function(n){t.resolve({media:n,constraints:e})})).catch((function(n){var r="string"==typeof n?n:[n.name,n.message].join(": ");v("[gum:getUserMedia]","Failure in getUserMedia: ".concat(r,". Attempting other resolution tests...")),v("[gUM:findformat]","Constraints declined by browser: ".concat(JSON.stringify(e,null,2))),t.reject("Could not find proper camera for provided constraints.")}))}(e,n)},Be=function(){return bt&>&&_t},Ve=function(){try{var e=new bt(null);return e.createDataChannel({name:"test"}).close(),e.close(),!!Be()}catch(e){return v("Could not detect RTCDataChannel support: ".concat(e.message)),!1}},Ge=(window.RTCRtpScriptTransform,!!window.MediaStreamTrackGenerator),We=(window.MediaStreamTrackProcessor,function(){return!!wt.prototype.createEncodedStreams}),Ye=function(e,t,n,r){var o=new Et(t),i=new Ct(t.kind),a=o.readable,s=i.writable;return n.postMessage({type:e,readable:a,writable:s,options:r},[a,s]),{processor:o,generator:i}},ze=function(e,t,n,r){var o=t.createEncodedStreams(),i=o.readable,a=o.writable;return n.postMessage({type:e,readable:i,writable:a,options:r},[i,a]),{readable:i,writable:a}},Ke=function(e,t,n,r){var o=t.createEncodedStreams(),i=o.readable,a=o.writable;return n.postMessage({type:e,readable:i,writable:a,options:r},[i,a]),{readable:i,writable:a}},Je=function(){var e=Ne(Le().mark((function e(t,n,r){var o,i,a;return Le().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=new Et(t),i=new Ct(t.kind),a=new St({transform:n}),o.readable.pipeThrough(a,r).pipeTo(i.writable).catch((function(e){if(r){var t=r.signal;t&&t.abort(e)}y("[PIPE:pipeGeneratorTransform]",e.message)})),e.abrupt("return",{processor:o,generator:i});case 6:case"end":return e.stop()}}),e)})));return function(t,n,r){return e.apply(this,arguments)}}(),qe=function(){var e=Ne(Le().mark((function e(t,n,r){var o,i,a,s;return Le().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=new St({transform:n}),i=t.createEncodedStreams(),a=i.readable,s=i.writable,a.pipeThrough(o,r).pipeTo(s).catch((function(e){if(a.cancel(e),r){var t=r.signal;t&&t.abort(e)}y("[PIPE:pipeSenderTransform]",e.message)})),e.abrupt("return",{readable:a,writable:s});case 6:case"end":return e.stop()}}),e)})));return function(t,n,r){return e.apply(this,arguments)}}(),Xe=function(){var e=Ne(Le().mark((function e(t,n,r){var o,i,a,s;return Le().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=new St({transform:n}),i=t.createEncodedStreams(),a=i.readable,s=i.writable,a.pipeThrough(o,r).pipeTo(s).catch((function(e){if(a.cancel(e),r){var t=r.signal;t&&t.abort(e)}y("[PIPE:pipeReceiverTransfo