red5pro-webrtc-sdk
Version:
Red5 Pro HTML SDK
33 lines • 370 kB
JavaScript
/*!
*
* red5pro-sdk - Red5 Pro HTML Publisher and Subscriber SDK.
* Author: Infrared5 Inc.
* Version: 14.2.0-release.b178
* 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 mc})),n.d(t,"Red5ProSubscriber",(function(){return yc})),n.d(t,"RTCSubscriber",(function(){return bc})),n.d(t,"WHEPClient",(function(){return gc})),n.d(t,"RTMPSubscriber",(function(){return _c})),n.d(t,"HLSSubscriber",(function(){return wc})),n.d(t,"PlaybackView",(function(){return Jr})),n.d(t,"Red5ProPublisher",(function(){return Sc})),n.d(t,"RTCPublisher",(function(){return Ec})),n.d(t,"WHIPClient",(function(){return Cc})),n.d(t,"RTMPPublisher",(function(){return kc})),n.d(t,"PublisherView",(function(){return ma})),n.d(t,"PlaybackControls",(function(){return Ln})),n.d(t,"PublisherEventTypes",(function(){return Pc})),n.d(t,"RTCPublisherEventTypes",(function(){return Oc})),n.d(t,"FailoverPublisherEventTypes",(function(){return Tc})),n.d(t,"SubscriberEventTypes",(function(){return Rc})),n.d(t,"RTCSubscriberEventTypes",(function(){return Ac})),n.d(t,"RTMPSubscriberEventTypes",(function(){return Nc})),n.d(t,"FailoverSubscriberEventTypes",(function(){return jc})),n.d(t,"MessageTransportStateEventTypes",(function(){return Hc})),n.d(t,"RTCConferenceParticipantEventType",(function(){return Lc})),n.d(t,"PlaybackAudioEncoder",(function(){return Ic})),n.d(t,"PlaybackVideoEncoder",(function(){return Dc})),n.d(t,"PublishAudioEncoder",(function(){return xc})),n.d(t,"PublishVideoEncoder",(function(){return Mc})),n.d(t,"IceTransportTypes",(function(){return Fc})),n.d(t,"TransformFrameTypes",(function(){return Uc})),n.d(t,"setLogLevel",(function(){return Bc})),n.d(t,"getRecordedLogs",(function(){return f})),n.d(t,"LOG_LEVELS",(function(){return Vc})),n.d(t,"getLogger",(function(){return Gc}));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/babel/babel/blob/main/packages/babel-helpers/LICENSE */R=function(){return t};var e,t={},n=Object.prototype,r=n.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",s=o.toStringTag||"@@toStringTag";function c(e,t,n,r){return Object.defineProperty(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r})}try{c({},"")}catch(e){c=function(e,t,n){return e[t]=n}}function u(t,n,r,o){var i=n&&n.prototype instanceof h?n:h,a=Object.create(i.prototype);return c(a,"_invoke",function(t,n,r){var o=1;return function(i,a){if(3===o)throw Error("Generator is already running");if(4===o){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=w(s,r);if(c){if(c===d)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(1===o)throw o=4,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=3;var u=l(t,n,r);if("normal"===u.type){if(o=r.done?4:2,u.arg===d)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(o=4,r.method="throw",r.arg=u.arg)}}}(t,r,new C(o||[])),!0),a}function l(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=u;var d={};function h(){}function f(){}function p(){}var v={};c(v,i,(function(){return this}));var m=Object.getPrototypeOf,y=m&&m(m(k([])));y&&y!==n&&r.call(y,i)&&(v=y);var b=p.prototype=h.prototype=Object.create(v);function g(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function _(e,t){function n(o,i,a,s){var c=l(e[o],e,i);if("throw"!==c.type){var u=c.arg,d=u.value;return d&&"object"==P(d)&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,a,s)}),(function(e){n("throw",e,a,s)})):t.resolve(d).then((function(e){u.value=e,a(u)}),(function(e){return n("throw",e,a,s)}))}s(c.arg)}var o;c(this,"_invoke",(function(e,r){function i(){return new t((function(t,o){n(e,r,t,o)}))}return o=o?o.then(i,i):i()}),!0)}function w(t,n){var r=n.method,o=t.i[r];if(o===e)return n.delegate=null,"throw"===r&&t.i.return&&(n.method="return",n.arg=e,w(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var i=l(o,t.i,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,d;var a=i.arg;return a?a.done?(n[t.r]=a.value,n.next=t.n,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,d):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,d)}function S(e){this.tryEntries.push(e)}function E(t){var n=t[4]||{};n.type="normal",n.arg=e,t[4]=n}function C(e){this.tryEntries=[[-1]],e.forEach(S,this),this.reset(!0)}function k(t){if(null!=t){var n=t[i];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=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 a.next=a}}throw new TypeError(P(t)+" is not iterable")}return f.prototype=p,c(b,"constructor",p),c(p,"constructor",f),f.displayName=c(p,s,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,p):(e.__proto__=p,c(e,s,"GeneratorFunction")),e.prototype=Object.create(b),e},t.awrap=function(e){return{__await:e}},g(_.prototype),c(_.prototype,a,(function(){return this})),t.AsyncIterator=_,t.async=function(e,n,r,o,i){void 0===i&&(i=Promise);var a=new _(u(e,n,r,o),i);return t.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},g(b),c(b,s,"Generator"),c(b,i,(function(){return this})),c(b,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),n=[];for(var r in t)n.unshift(r);return function e(){for(;n.length;)if((r=n.pop())in t)return e.value=r,e.done=!1,e;return e.done=!0,e}},t.values=k,C.prototype={constructor:C,reset:function(t){if(this.prev=this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(E),!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][4];if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function r(e){a.type="throw",a.arg=t,n.next=e}for(var o=n.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i[4],s=this.prev,c=i[1],u=i[2];if(-1===i[0])return r("end"),!1;if(!c&&!u)throw Error("try statement without catch or finally");if(null!=i[0]&&i[0]<=s){if(s<c)return this.method="next",this.arg=e,r(c),!0;if(s<u)return r(u),!1}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r[0]>-1&&r[0]<=this.prev&&this.prev<r[2]){var o=r;break}}o&&("break"===e||"continue"===e)&&o[0]<=t&&t<=o[2]&&(o=null);var i=o?o[4]:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o[2],d):this.complete(i)},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),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n[2]===e)return this.complete(n[4],n[3]),E(n),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n[0]===e){var r=n[4];if("throw"===r.type){var o=r.arg;E(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={i:k(t),r:n,n:r},"next"===this.method&&(this.arg=e),d}},t}function A(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,N(r.key),r)}}function N(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 j=new WeakMap,H=function(e){return j.has(e)||j.set(e,{}),j.get(e)},L=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)})),H(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=H(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,H(t).find(e,n,r,o,i,a)}))}else o.reject(a)},H(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 H(this).find(this.listorder(e.slice()),t,n,o,r),o.promise}}])&&A(e.prototype,t),n&&A(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 D(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,x(r.key),r)}}function x(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)}}])&&D(e.prototype,t),n&&D(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})),z=B((function e(t){G(this,e),this.name="InvalidNameError",this.message=t})),K=/['"](.*?)['"]:/gi,Y=/:['"](.*?)['"]/gi,J=new WeakMap;function q(e,t){try{return JSON.parse(e)[t]}catch(o){var n,r=K.exec(e);return r&&r.length>1&&(n=Y.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 Ae(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */Ae=function(){return t};var e,t={},n=Object.prototype,r=n.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",s=o.toStringTag||"@@toStringTag";function c(e,t,n,r){return Object.defineProperty(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r})}try{c({},"")}catch(e){c=function(e,t,n){return e[t]=n}}function u(t,n,r,o){var i=n&&n.prototype instanceof h?n:h,a=Object.create(i.prototype);return c(a,"_invoke",function(t,n,r){var o=1;return function(i,a){if(3===o)throw Error("Generator is already running");if(4===o){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=w(s,r);if(c){if(c===d)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(1===o)throw o=4,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=3;var u=l(t,n,r);if("normal"===u.type){if(o=r.done?4:2,u.arg===d)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(o=4,r.method="throw",r.arg=u.arg)}}}(t,r,new C(o||[])),!0),a}function l(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=u;var d={};function h(){}function f(){}function p(){}var v={};c(v,i,(function(){return this}));var m=Object.getPrototypeOf,y=m&&m(m(k([])));y&&y!==n&&r.call(y,i)&&(v=y);var b=p.prototype=h.prototype=Object.create(v);function g(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function _(e,t){function n(o,i,a,s){var c=l(e[o],e,i);if("throw"!==c.type){var u=c.arg,d=u.value;return d&&"object"==Re(d)&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,a,s)}),(function(e){n("throw",e,a,s)})):t.resolve(d).then((function(e){u.value=e,a(u)}),(function(e){return n("throw",e,a,s)}))}s(c.arg)}var o;c(this,"_invoke",(function(e,r){function i(){return new t((function(t,o){n(e,r,t,o)}))}return o=o?o.then(i,i):i()}),!0)}function w(t,n){var r=n.method,o=t.i[r];if(o===e)return n.delegate=null,"throw"===r&&t.i.return&&(n.method="return",n.arg=e,w(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var i=l(o,t.i,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,d;var a=i.arg;return a?a.done?(n[t.r]=a.value,n.next=t.n,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,d):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,d)}function S(e){this.tryEntries.push(e)}function E(t){var n=t[4]||{};n.type="normal",n.arg=e,t[4]=n}function C(e){this.tryEntries=[[-1]],e.forEach(S,this),this.reset(!0)}function k(t){if(null!=t){var n=t[i];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=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 a.next=a}}throw new TypeError(Re(t)+" is not iterable")}return f.prototype=p,c(b,"constructor",p),c(p,"constructor",f),f.displayName=c(p,s,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,p):(e.__proto__=p,c(e,s,"GeneratorFunction")),e.prototype=Object.create(b),e},t.awrap=function(e){return{__await:e}},g(_.prototype),c(_.prototype,a,(function(){return this})),t.AsyncIterator=_,t.async=function(e,n,r,o,i){void 0===i&&(i=Promise);var a=new _(u(e,n,r,o),i);return t.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},g(b),c(b,s,"Generator"),c(b,i,(function(){return this})),c(b,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),n=[];for(var r in t)n.unshift(r);return function e(){for(;n.length;)if((r=n.pop())in t)return e.value=r,e.done=!1,e;return e.done=!0,e}},t.values=k,C.prototype={constructor:C,reset:function(t){if(this.prev=this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(E),!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][4];if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function r(e){a.type="throw",a.arg=t,n.next=e}for(var o=n.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i[4],s=this.prev,c=i[1],u=i[2];if(-1===i[0])return r("end"),!1;if(!c&&!u)throw Error("try statement without catch or finally");if(null!=i[0]&&i[0]<=s){if(s<c)return this.method="next",this.arg=e,r(c),!0;if(s<u)return r(u),!1}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r[0]>-1&&r[0]<=this.prev&&this.prev<r[2]){var o=r;break}}o&&("break"===e||"continue"===e)&&o[0]<=t&&t<=o[2]&&(o=null);var i=o?o[4]:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o[2],d):this.complete(i)},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),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n[2]===e)return this.complete(n[4],n[3]),E(n),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n[0]===e){var r=n[4];if("throw"===r.type){var o=r.arg;E(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={i:k(t),r:n,n:r},"next"===this.method&&(this.arg=e),d}},t}function Ne(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 je(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Ne(i,r,o,a,s,"next",e)}function s(e){Ne(i,r,o,a,s,"throw",e)}a(void 0)}))}}var He,Le=[{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},De=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})),xe=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(De(t))(e);return v("[gum:hasMatchingFormat]","Filtered list: "+JSON.stringify(n,null,2)),n.length>0})),Fe=Ee((function(e,t){var n=xe(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 gt&&_t&&wt},Ve=function(){try{var e=new gt(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!!St.prototype.createEncodedStreams}),ze=function(e,t,n,r){var o=new Ct(t),i=new kt(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}},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}},Ye=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=je(Ae().mark((function e(t,n,r){var o,i,a;return Ae().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=new Ct(t),i=new kt(t.kind),a=new Et({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=je(Ae().mark((function e(t,n,r){var o,i,a,s;return Ae().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=new Et({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=je(Ae().mark((function e(t,n,r){var o,i,a,s;return Ae().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=new Et({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:pipeReceiverTransform",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)}}(),$e=function(e,t){var n=new C,r=Me(Le);v("[gum:getUserMedia]","Is Available in format listing: "+r(e));var o=function(r){if(r){var o="string"==typeof r?r:[r.name,r.message].join(": ");v("[gum:getUserMedia]","Failure in getUserMedia: ".concat(o,". Attempting other resolution tests..."))}(function(e){v("[gum:determineSupportedResolution]","Determine next neighbor based on constraints: "+JSON.stringify(e,null,2));var t=new C,n=Fe(Le)(e),r=Pe(e);return Ue(r,n,t),t.promise})(e).then((function(e){n.resolve({media:e.media,constraints:e.constraints})})).catch((function(r){t&&t(e),n.reject({error:r,constraints:e})}))};if(function(e){return e.hasOwnProperty("video")&&(e.video.hasOwnProperty("width")||e.video.hasOwnProperty("height"))}(e))if(r(e)){v("[gum:getUserMedia]","Found constraints in list. Checking quick support for faster setup with: "+JSON.stringify(e,null,2));var i=function(e){var t=Pe(e);return"boolean"==typeof e.video||(e.video.width&&(t.video.width={exact:Ie(e.video.width)}),e.video.height&&(t.video.height={exact:Ie(e.video.height)})),t}(e);ve.gUM(i).then((function(e){n.resolve({media:e,constraints:i})})).catch(o)}else v("[gum:getUserMedia]","Could not find contraints in list. Attempting failover...