dd35d66ea8d8a84dd42b6b93ed4257db6259372c9eb33aefae8e2f48593986b7

Source Code:

!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.NanoPlayer=t():e.NanoPlayer=t()}(this,function(){return function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return e[r].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){var r,o;r=[n(1)],o=function(e){return window.NanoPlayer=e,e}.apply(t,r),!(void 0!==o&&(e.exports=o))},function(e,t,n){var r,o;r=[n(3),n(9),n(5),n(6),n(7),n(8),n(2),n(17),n(21),n(100),n(23),n(101)],o=function(e,t,n,r,o,i,a,s,u,c,d,f){"use strict";function E(t){d.validatePlayerDivId(t),this.version=s.CORE,console.debug("NanoCore api version: "+this.version),this.type="default",this.id=Math.round(1e11*Math.random()).toString(),this._playerDivId=t,this._dummyPlayer=new e(this._playerDivId),this._realPlayer=this._dummyPlayer}var l=E.prototype=Object.create(e.prototype);return l.setup=function(e){return new f(function(n,r){var a=e&&e.events&&e.events.onError?e.events.onError:null,s=function(e){e.code||(e.code=u.SETUP.EXCEPTION),e.message||(e.message="An unknown error occured during setup.");var t={name:"Error",data:{code:e.code,message:e.message},player:this._playerDivId,id:this.id,version:this.version,state:i.IDLE};a&&this.on(t.name,a),this.emit(t.name,t),r(e)}.bind(this),d=function(e){n(e)};try{this._realPlayer&&this._realPlayer!==this._dummyPlayer&&(this._realPlayer.destroy(),this._realPlayer=this._dummyPlayer),t.create(this._playerDivId,e).then(function(t){this.version=t.version,this.type=t.type,this._realPlayer=t,this._realPlayer.id=this.id,this._propagator=c.create(t,o,this),this._realPlayer.setup(e).then(function(e){window.onunload=function(e){this._realPlayer.destroy()}.bind(this),d(e)}.bind(this),s)}.bind(this),function(e){s(e)})}catch(e){s(e)}}.bind(this))},l.destroy=function(){this._realPlayer.destroy()},l.play=function(){this._realPlayer.play()},l.pause=function(){this._realPlayer.pause()},l.mute=function(){this._realPlayer.mute()},l.unmute=function(){this._realPlayer.unmute()},l.setVolume=function(e){this._realPlayer.setVolume(e)},l.updateSource=function(e,t){return this._realPlayer.updateSource(e,t)},E.events=o,E.states=i,E.emptyConfig=n,E.validConfig=r,E.pauseReasons=a,E.errorCodes=u,E.version=s.CORE,E.capabilities=t.capabilities,E}.apply(t,r),/**
	 * @license
	 * nanoStream H5Live Player Core 0.0.0
	 * Build from 0/0/0
	 * Copyright (c) 2016-20 nanocosmos IT GmbH. All rights reserved.
	 * http://www.nanocosmos.de
	 * sales@nanocosmos.de
	 *
	 * LEGAL NOTICE:
	 * This material is subject to the terms and conditions defined in
	 * separate license conditions ('LICENSE.txt')
	 * All information contained herein is, and remains the property
	 * of nanocosmos GmbH and its suppliers if any. The intellectual and technical concepts
	 * contained herein are proprietary to nanocosmos GmbH, and are protected by trade secret
	 * or copyright law. Dissemination of this information or reproduction of this material
	 * is strictly forbidden unless prior written permission is obtained from nanocosmos.
	 * All modifications will remain property of nanocosmos.
	 */
!(void 0!==o&&(e.exports=o))},function(e,t,n){var r,o;r=[],o=function(){return Object.freeze({NORMAL:"normal",BUFFER:"buffer",CONNECTION_CLOSE:"connectionclose",SERVER_NOT_FOUND:"servernotfound",STREAM_NOT_FOUND:"streamnotfound",INTERACTION_REQUIRED:"interactionrequired",PLAYBACK_SUSPENDED:"playbacksuspended",PLAYBACK_ERROR:"playbackerror",RECONNECTION_IMMINENT:"reconnectionimminent",DESTROY:"destroy",PLAYBACK_RESTART:"playbackrestart",VISIBILITY_HIDDEN:"visibilityhidden",NOT_ENOUGH_DATA:"notenoughdata",SOURCE_STREAM_STOPPED:"sourcestreamstopped"})}.apply(t,r),!(void 0!==o&&(e.exports=o))},function(e,t,n){var r,o;r=[n(4)],o=function(e){"use strict";function t(){this.version=void 0,this.type=void 0}var n=t.prototype=Object.create(e.prototype);return n.setup=function(){throw new Error('"setup" must be implemented or player not initialized')},n.destroy=function(){throw new Error('"destroy" must be implemented or player not initialized')},n.play=function(){throw new Error('"play" must be implemented or player not initialized by call setup')},n.pause=function(){throw new Error('"pause" must be implemented or player not initialized by call setup')},n.mute=function(){throw new Error('"mute" must be implemented or player not initialized by call setup')},n.unmute=function(){throw new Error('"unmute" must be implemented or player not initialized by call setup')},n.setVolume=function(){throw new Error('"setVolume" must be implemented or player not initialized by call setup')},n.updateSource=function(){throw new Error('"updateSource" must be implemented or player not initialized by call setup')},t.isSupported=function(){return!1},t.supportedTechniques=[],t}.apply(t,r),!(void 0!==o&&(e.exports=o))},function(e,t,n){var r,o;r=[],o=function(){"use strict";function e(){}function t(e,t){for(var n=e.length;n--;)if(e[n].listener===t)return n;return-1}function n(e){return function(){return this[e].apply(this,arguments)}}var r=e.prototype;return r.getListeners=function(e){var t,n,r=this._getEvents();if(e instanceof RegExp){t={};for(n in r)r.hasOwnProperty(n)&&e.test(n)&&(t[n]=r[n])}else t=r[e]||(r[e]=[]);return t},r.flattenListeners=function(e){var t,n=[];for(t=0;t<e.length;t+=1)n.push(e[t].listener);return n},r.getListenersAsObject=function(e){var t,n=this.getListeners(e);return n instanceof Array&&(t={},t[e]=n),t||n},r.addListener=function(e,n){var r,o=this.getListenersAsObject(e),i="object"==typeof n;for(r in o)o.hasOwnProperty(r)&&t(o[r],n)===-1&&o[r].push(i?n:{listener:n,once:!1});return this},r.on=n("addListener"),r.addOnceListener=function(e,t){return this.addListener(e,{listener:t,once:!0})},r.once=n("addOnceListener"),r.defineEvent=function(e){return this.getListeners(e),this},r.defineEvents=function(e){for(var t=0;t<e.length;t+=1)this.defineEvent(e[t]);return this},r.removeListener=function(e,n){var r,o,i=this.getListenersAsObject(e);for(o in i)i.hasOwnProperty(o)&&(r=t(i[o],n),r!==-1&&i[o].splice(r,1));return this},r.off=n("removeListener"),r.addListeners=function(e,t){return this.manipulateListeners(!1,e,t)},r.removeListeners=function(e,t){return this.manipulateListeners(!0,e,t)},r.manipulateListeners=function(e,t,n){var r,o,i=e?this.removeListener:this.addListener,a=e?this.removeListeners:this.addListeners;if("object"!=typeof t||t instanceof RegExp)for(r=n.length;r--;)i.call(this,t,n[r]);else for(r in t)t.hasOwnProperty(r)&&(o=t[r])&&("function"==typeof o?i.call(this,r,o):a.call(this,r,o));return this},r.removeEvent=function(e){var t,n=typeof e,r=this._getEvents();if("string"===n)delete r[e];else if(e instanceof RegExp)for(t in r)r.hasOwnProperty(t)&&e.test(t)&&delete r[t];else delete this._events;return this},r.removeAllListeners=n("removeEvent"),r.emitEvent=function(e,t){var n,r,o,i,a,s=this.getListenersAsObject(e);for(i in s)if(s.hasOwnProperty(i))for(n=s[i].slice(0),o=n.length;o--;)r=n[o],r.once===!0&&this.removeListener(e,r.listener),a=r.listener.apply(this,t||[]),a===this._getOnceReturnValue()&&this.removeListener(e,r.listener);return this},r.trigger=n("emitEvent"),r.emit=function(e){var t=Array.prototype.slice.call(arguments,1);return t.length?t.length&&"object"!=typeof t[0]?t[0]={name:e,data:t[0]}:t.length&&!t[0].hasOwnProperty("data")?t[0]={name:e,data:t[0]}:t[0].name=e:t.push({name:e,data:{}}),this.emitEvent(e,t)},r.emitSimple=function(e,t,n){return this.emitEvent(e,[{name:e||"AnonymousEvent",target:n||this,data:t||{}}])},r.setOnceReturnValue=function(e){return this._onceReturnValue=e,this},r._getOnceReturnValue=function(){return!this.hasOwnProperty("_onceReturnValue")||this._onceReturnValue},r._getEvents=function(){return this._events||(this._events={})},e}.apply(t,r),/*!
	 * EventEmitter v4.2.11 - git.io/ee
	 * Unlicense - http://unlicense.org/
	 * Oliver Caldwell - http://oli.me.uk/
	 * @preserve
	 */
!(void 0!==o&&(e.exports=o))},function(e,t,n){var r,o;r=[],o=function(){function e(){return{playback:{autoplay:!0,automute:!1,muted:!1,metadata:!1,forceTech:"",flashplayer:"",videoId:"",keepConnection:!1,allowSafariHlsFallback:!1,reconnect:{minDelay:2,maxDelay:10,delaySteps:10,maxRetries:10},timeouts:{loading:20,buffering:20,connecting:5}},source:{hls:"",h5live:{server:{websocket:"",progressive:"",hls:""},token:"",rtmp:{url:"",streamname:""},security:{token:"",expires:"",options:"",tag:""},params:{}}},events:{onReady:void 0,onPlay:void 0,onPause:void 0,onLoading:void 0,onStartBuffering:void 0,onStopBuffering:void 0,onError:void 0,onMetaData:void 0,onFullscreenEnter:void 0,onFullscreenExit:void 0,onPlaybackFinished:void 0,onMedia:void 0,onStats:void 0,onMute:void 0,onUnmute:void 0,onVolumeChange:void 0,onStreamInfo:void 0,onStreamInfoUpdate:void 0,onWarning:void 0,onDestroy:void 0,onUpdateSourceInit:void 0,onUpdateSourceSuccess:void 0,onUpdateSourceError:void 0,onUpdateSourceTimeout:void 0},tweaks:{buffer:{min:void 0,start:void 0,max:void 0,target:void 0,limit:void 0},bufferDynamic:{offsetThreshold:void 0,offsetStep:void 0,cooldownTime:void 0}}}}return{create:e}}.apply(t,r),!(void 0!==o&&(e.exports=o))},function(e,t,n){var r,o;r=[],o=function(){function e(){return{source:{hls:"string",h5live:{server:{websocket:"string",progressive:"string",hls:"string"},token:"string",rtmp:{url:"string",streamname:"string"},params:"object",security:{token:"string",expires:"string",options:"string",tag:"string"}}},playback:{autoplay:"boolean",automute:"boolean",muted:"boolean",forceTech:"string",metadata:"boolean",flashplayer:"string",videoId:"string",keepConnection:"boolean",allowSafariHlsFallback:"boolean",reconnect:{minDelay:"number",maxDelay:"number",delaySteps:"number",maxRetries:"number"},timeouts:{loading:"number",buffering:"number",connecting:"number"}},events:{onReady:"function",onPlay:"function",onPause:"function",onLoading:"function",onStartBuffering:"function",onStopBuffering:"function",onError:"function",onMetaData:"function",onStats:"function",onMute:"function",onUnmute:"function",onVolumeChange:"function",onStreamInfo:"function",onStreamInfoUpdate:"function",onWarning:"function",onDestroy:"function",onUpdateSourceInit:"function",onUpdateSourceSuccess:"function",onUpdateSourceError:"function",onUpdateSourceTimeout:"function"},tweaks:{buffer:{max:"number",min:"number",start:"number",target:"number",limit:"number"},bufferDynamic:{offsetThreshold:"number",offsetStep:"number",cooldownTime:"number"}}}}return{create:e}}.apply(t,r),!(void 0!==o&&(e.exports=o))},function(e,t,n){var r,o;r=[],o=function(){return Object.freeze({READY:"Ready",ERROR:"Error",PAUSE:"Pause",LOADING:"Loading",START_BUFFERING:"StartBuffering",STOP_BUFFERING:"StopBuffering",PLAY:"Play",METADATA:"MetaData",STATS:"Stats",PLAYBACK_FINISHED:"PlaybackFinished",MEDIA:"Media",STREAM_INFO:"StreamInfo",STREAM_INFO_UPDATE:"StreamInfoUpdate",MUTE:"Mute",UNMUTE:"Unmute",VOLUME_CHANGE:"VolumeChange",STATE_CHANGE:"StateChange",WARNING:"Warning",DESTROY:"Destroy",UPDATE_SOURCE_INIT:"UpdateSourceInit",UPDATE_SOURCE_SUCCESS:"UpdateSourceSuccess",UPDATE_SOURCE_FAIL:"UpdateSourceFail",UPDATE_SOURCE_ABORT:"UpdateSourceAbort"})}.apply(t,r),!(void 0!==o&&(e.exports=o))},function(e,t,n){var r,o;r=[],o=function(){return Object.freeze({UNINITIALIZED:1,IDLE:2,READY:3,LOADING:4,PLAYING:5,PAUSED:6,BUFFERING:7,UNKNOWN:8,PLAYBACK_NOT_STARTED:9,PLAYBACK_SUSPENDED:10,PAUSING:11,PLAYBACK_ERROR:12,RECONNECTION_IMMINENT:13,CONNECTION_ERROR:14,DESTROYING:15,PLAYBACK_RESTARTING:16,VISIBILITY_HIDDEN:17,NOT_ENOUGH_DATA:18,SOURCE_STREAM_STOPPED:19})}.apply(t,r),!(void 0!==o&&(e.exports=o))},function(e,t,n){var r,o;r=[n(10),n(11),n(12),n(99),n(24),n(21)],o=function(e,t,n,r,o,i){function a(e){var n=e.filter(function(e){return e.isSupported()});if(!n.length)throw new t(r.CLIENT_NOT_SUPPORTED,i.SETUP.CLIENT_NOT_SUPPORTED);return n}function s(e,n){var a={};a[o.H5LIVE_WSS]="h5live",a[o.H5LIVE_HLS]="h5live",a[o.FLASH]="h5live",a[o.NATIVE]="hls";var s=[],u=e.filter(function(e){var t=!1;return e.supportedTechniques.forEach(function(e){s.push(a[e]),t===!1&&(t=n.hasOwnProperty("source")&&n.source.hasOwnProperty(a[e]))}),t});if(!u.length)throw new t(r.SOURCE_NOT_SUPPORTED,i.SETUP.SOURCE_NOT_SUPPORTED);return u}function u(e,n){var o=[],a=function(e,t){return e.indexOf(t)!==-1||t.indexOf(e)!==-1},s=e.filter(function(e){o=o.concat(e.supportedTechniques);var t=!1;return e.supportedTechniques.forEach(function(e){t===!1&&(t=!n.playback.forceTech||a(e,n.playback.forceTech))}),t});if(!s.length)throw new t(r.FORCE_NOT_SUPPORTED.replace("$tech$",n.playback.forceTech),i.SETUP.FORCE_NOT_SUPPORTED);return s}function c(e,t){var n=e[0];return new n(t)}function d(e,t){return new Promise(function(r,o){var i=n;try{i=a(i),i=s(i,t),i=u(i,t),r(c(i,e))}catch(e){o(e)}})}function f(){var e=[];return n.filter(function(e){return e.isSupported()}).forEach(function(t){e=e.concat(t.supportedTechniques)}),e}return{create:d,capabilities:f()}}.apply(t,r),!(void 0!==o&&(e.exports=o))},function(e,t,n){var r,o;r=[],o=function(){"use strict";var e="Unknown",t="";if(screen.width){var n=screen.width?screen.width:"",r=screen.height?screen.height:"";t+=""+n+" x "+r}var o,i,a,s=navigator.appVersion,u=navigator.userAgent,c=navigator.appName,d=""+parseFloat(navigator.appVersion),f=parseInt(navigator.appVersion,10),E=e,l=navigator.plugins;if((i=u.indexOf("Opera"))!==-1&&(c="Opera",d=u.substring(i+6),(i=u.indexOf("Version"))!==-1&&(d=u.substring(i+8)),E="Chromium"),(i=u.indexOf("SamsungBrowser"))!==-1)c="Samsung Browser",d=u.substring(i+15),E="Chromium";else if((i=u.indexOf("Edg/"))!==-1)c="Microsoft Edge Chromium",d=u.substring(i+4),E="Chromium";else if((i=u.indexOf("UCBrowser"))!==-1)c="UC Browser",d=u.substring(i+10),E="Blink";else if((i=u.indexOf("YaBrowser"))!==-1)c="Yandex Browser",d=u.substring(i+10),E="Blink";else if((i=u.indexOf("QIHU 360EE"))!==-1||(i=u.indexOf("360Browser"))!==-1)c="Qihoo 360 Browser",d="0",E="Blink";else if((i=u.indexOf("Iron"))!==-1)c="Iron Browser",d=u.substring(i+5),E="Chromium";else if((i=u.indexOf("Vivaldi"))!==-1)c="Vivaldi Browser",d=u.substring(i+8),E="Chromium";else if((i=u.indexOf("OPR/"))!==-1)c="Opera",d=u.substring(i+4),E="Chromium";else if((i=u.indexOf("MSIE"))!==-1)c="Microsoft Internet Explorer",d=u.substring(i+5),E="Trident";else if("Netscape"===c&&(i=u.indexOf("Trident/"))!==-1)c="Microsoft Internet Explorer",d=u.substring(i+8),(i=u.indexOf("rv:"))!==-1&&(d=u.substring(i+3)),E="Trident";else if("Netscape"===c&&(i=u.indexOf("Edge/"))!==-1)c="Microsoft Edge Trident",d=u.substring(i+5),E="Trident";else if((i=u.indexOf("Chrome"))!==-1){var p=["Chromium PDF Viewer","Native Client","Chromium PDF Plugin"];c="Chrome";for(var T=0;T<l.length;T++){p.includes(l[T].name)&&(c="Chromium");break}d=u.substring(i+7),E="Chromium"}else(i=u.indexOf("PhantomJS"))!==-1?(c="PhantomJS",d=u.substring(i+10),E="Webkit"):(i=u.indexOf("Safari"))!==-1?(c="Safari",d=u.substring(i+7),(i=u.indexOf("Version"))!==-1&&(d=u.substring(i+8)),u.indexOf("CriOS")!==-1&&(c="Chrome"),E="Webkit"):(i=u.indexOf("Firefox"))!==-1?(c="Firefox",d=u.substring(i+8),E="Firefox"):(o=u.lastIndexOf(" ")+1)<(i=u.lastIndexOf("/"))&&(c=u.substring(o,i),d=u.substring(i+1),c.toLowerCase()===c.toUpperCase()&&(c=navigator.appName));(a=d.indexOf(";"))!==-1&&(d=d.substring(0,a)),(a=d.indexOf(" "))!==-1&&(d=d.substring(0,a)),(a=d.indexOf(")"))!==-1&&(d=d.substring(0,a)),f=parseInt(""+d,10),isNaN(f)&&(d=""+parseFloat(navigator.appVersion),f=parseInt(navigator.appVersion,10));var m=/Mobile|mini|Fennec|Android|iP(ad|od|hone)/.test(s),A=!!navigator.cookieEnabled;"undefined"!=typeof navigator.cookieEnabled||A||(document.cookie="testcookie",A=document.cookie.indexOf("testcookie")!==-1);var _=e,S=[{s:"Windows 3.11",r:/Win16/},{s:"Windows 95",r:/(Windows 95|Win95|Windows_95)/},{s:"Windows ME",r:/(Win 9x 4.90|Windows ME)/},{s:"Windows 98",r:/(Windows 98|Win98)/},{s:"Windows CE",r:/Windows CE/},{s:"Windows 2000",r:/(Windows NT 5.0|Windows 2000)/},{s:"Windows XP",r:/(Windows NT 5.1|Windows XP)/},{s:"Windows Server 2003",r:/Windows NT 5.2/},{s:"Windows Vista",r:/Windows NT 6.0/},{s:"Windows 7",r:/(Windows 7|Windows NT 6.1)/},{s:"Windows 8.1",r:/(Windows 8.1|Windows NT 6.3)/},{s:"Windows 8",r:/(Windows 8|Windows NT 6.2)/},{s:"Windows 10",r:/(Windows 10|Windows NT 10.0)/},{s:"Windows NT 4.0",r:/(Windows NT 4.0|WinNT4.0|WinNT|Windows NT)/},{s:"Windows ME",r:/Windows ME/},{s:"Android",r:/Android/},{s:"Open BSD",r:/OpenBSD/},{s:"Sun OS",r:/SunOS/},{s:"Linux",r:/(Linux|X11)/},{s:"iOS",r:/(iPhone|iPad|iPod)/},{s:"Mac OS X",r:/Mac OS X/},{s:"Mac OS",r:/(MacPPC|MacIntel|Mac_PowerPC|Macintosh)/},{s:"QNX",r:/QNX/},{s:"UNIX",r:/UNIX/},{s:"BeOS",r:/BeOS/},{s:"OS/2",r:/OS\/2/},{s:"Search Bot",r:/(nuhk|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask Jeeves\/Teoma|ia_archiver)/}];for(var h in S){var R=S[h];if(R.r.test(u)){_=R.s;break}}var O=e;switch(/Windows/.test(_)&&(/Windows (.*)/.exec(_)&&(O=/Windows (.*)/.exec(_)[1]),_="Windows"),_){case"Mac OS X":/Mac OS X (10[._\d]+)/.exec(u)&&(O=/Mac OS X (10[._\d]+)/.exec(u)[1]);break;case"Android":/Android ([._\d]+)/.exec(u)&&(O=/Android ([._\d]+)/.exec(u)[1]);break;case"iOS":O=/OS (\d+)_(\d+)_?(\d+)?/.exec(s),O=O?O[1]+"."+O[2]+"."+(0|O[3]):e}var g={screen:t,browser:c,browserVersion:d,mobile:m,os:_,osVersion:O,cookies:A,browserEngine:E};return g}.apply(t,r),!(void 0!==o&&(e.exports=o))},function(e,t,n){var r,o;r=[],o=function(){function e(e,t){var n=new window.Error(e||"");return n.code=t||0,n}return e}.apply(t,r),!(void 0!==o&&(e.exports=o))},function(e,t,n){var r,o;r=[n(13),n(13)],o=function(){for(var e=[],t=0;t<arguments.length;t++)e.push(arguments[t]);return e}.apply(t,r),!(void 0!==o&&(e.exports=o))},function(e,t,n){var r,o;r=[n(3),n(15),n(14),n(17),n(10),n(18),n(19),n(4),n(22),n(23),n(25),n(11),n(5),n(6),n(8),n(27),n(7),n(21),n(24),n(2),n(28),n(33),n(34),n(36),n(38),n(56),n(70),n(29),n(31),n(30),n(32),n(40)],o=function(e,t,n,r,o,i,a,s,u,c,d,f,E,l,p,T,m,A,_,S,h,R,O,g,N,v,y,I,C,b,D,P){"use strict";function U(e){c.validatePlayerDivId(e),this._setBaseValues(e)}var L=i.log;U.getSupportedTechniques=function(){var e=[];return d.isH5LiveKnownUnsupported||(d.hasMediaSource&&e.push(_.H5LIVE_WSS),(d.mustUseHLS||d.canUseHLS)&&e.push(_.H5LIVE_HLS)),e},U.supportedTechniques=U.getSupportedTechniques(),U.isSupported=function(){return U.supportedTechniques.length>0};var w=U.prototype=Object.create(e.prototype);return w._setBaseValues=function(e){this.version=r.CORE,this.type="h5live",this.networkState=this.NETWORK_STATE.UNINITIALIZED,this._info=o,this.config=E.create(),this._playerDivId="",this._playing=!1,this._updating=!1,this._serverInfo=null,this._pauseReason="",this._playerDivId=e,this._mediaElementId="h5live-"+e,this._componentEmitter=new s,this._componentListeners={logic:[{type:C.SERVER_INFO,listener:this._onServerInfo.bind(this)},{type:C.STREAM_INFO,listener:this._onStreamInfo.bind(this)},{type:C.STREAM_INFO_UPDATE,listener:this._onStreamInfoUpdate.bind(this)},{type:C.NO_KEEP_CONNECTION,listener:this._onNoKeepConnection.bind(this)},{type:C.MIME_TYPE_UNSUPPORTED,listener:this._onMimeTypeUnsupported.bind(this)},{type:C.ERROR,listener:this._onLogicError.bind(this)},{type:C.UPDATE_SOURCE_INIT,listener:this._onUpdateSourceInit.bind(this)}],network:[{type:D.CONNECTING,listener:this._onConnectionConnecting.bind(this)},{type:D.CONNECTED,listener:this._onConnectionOpen.bind(this)},{type:D.DISCONNECTED,listener:this._onConnectionClosed.bind(this)},{type:D.RECONNECTING,listener:this._onConnectionReconnecting.bind(this)},{type:D.RECONNECTION_IMMINENT,listener:this._onConnectionReconnectionImminent.bind(this)},{type:D.DESTROYED,listener:this._onConnectionDestroyed.bind(this)},{type:D.INITIALIZATION_ERROR,listener:this._onConnectionInitializationError.bind(this)},{type:D.CONNECTION_ERROR,listener:this._onConnectionError.bind(this)},{type:D.ERROR,listener:this._onConnectionError.bind(this)},{type:D.WARNING,listener:this._onConnectionWarning.bind(this)},{type:D.STATE_CHANGE,listener:this._onConnectionStateChange.bind(this)}],media:[{type:b.ERROR,listener:this._onError.bind(this)},{type:b.PLAYBACK_ERROR,listener:this._onMediaError.bind(this)},{type:b.PLAYBACK_STARTED,listener:this._onMediaPlaying.bind(this)},{type:b.PLAYBACK_SUSPENDED,listener:this._onMediaSuspended.bind(this)},{type:b.BUFFERING,listener:this._onMediaBuffering.bind(this)},{type:b.PLAY_START_ERROR,listener:this._onPlayStartError.bind(this)}]},this._setState(this.STATE.IDLE)},w._baseSetup=function(e,r){var o=a.check(r,l.create());a.merge(r,this.config),a.clean(this.config);var i;if(i=c.validateConfig(e,r))return i;r.playback.videoId&&(this._mediaElementId=r.playback.videoId),this._setListeners(this.config.events,this),o.forEach(function(e){this._emitWarning(e)}.bind(this));var s=document.getElementById(this._playerDivId);this._metaDataEnabled=this.config.playback.metadata;var u=this.config.source.h5live.params,d=this.config.source.h5live.rtmp,f=u&&u.url?u.url:d&&d.url?d.url:null,E=u&&u.stream?u.stream:d&&d.streamname?d.streamname:null;f&&E?this.config.url=f+"/"+E:this.config.url="",this.config.type=this.type,this.config.id=this.id,this._components={network:v.create(this._componentEmitter),media:y.create(this._componentEmitter),logic:N.create(this._componentEmitter),performance:O.create(this._componentEmitter,this._playerDivId),propagator:R.create(this._componentEmitter),error:g.create(this._componentEmitter),state:h.create(this._componentEmitter)};for(var p in this._components)this._componentListeners.hasOwnProperty(p)&&this._componentListeners[p].length&&t.add({target:this._componentEmitter,listeners:this._componentListeners[p]});for(var T in m)(this._outwardEvents||(this._outwardEvents=[]))&&this._outwardEvents.push({from:m[T],to:m[T]});return this._outwardTranslator=n.create(this._componentEmitter,this,this._outwardEvents),this._emitConfig(),this._setupVideoElement(s),i},w.setup=function(e){return new Promise(function(t,n){try{var r=this._baseSetup(U.supportedTechniques[0],e);r?n(r):(setTimeout(function(){this._setState(this.STATE.READY),this.emit(m.READY,{config:this.config}),this.config.playback.autoplay&&this.play()}.bind(this),20),t(this.config))}catch(e){n(e)}}.bind(this))},w._destroy=function(){this._setState(this.STATE.DESTROYING),this._playing&&this.pause(this.state),this.emit(m.DESTROY),this._outwardTranslator&&this._outwardTranslator.destroy(),this._outwardTranslator=null;for(var e in this._components)this._components.hasOwnProperty(e)&&(this._components[e].destroy(),delete this._components[e]);for(var n in this._componentListeners)this._componentListeners.hasOwnProperty(n)&&this._componentListeners[n].length&&t.remove({target:this._componentEmitter,listeners:this._componentListeners[n]});this.removeAllListeners()},w.destroy=w._destroy,w._emitConfig=function(){this._componentEmitter.emit(I.CONFIG,{config:u.copy(this.config)})},w._setState=function(e){var t=arguments.length>1?arguments[1]:{};this.state=e,t.state=e,this._componentEmitter.emit(C.STATE_CHANGE,t)},w._debug=function(e,t){L("nanoplayer ("+this._playerDivId+"): "+e,t)},w._setListeners=function(e,t){for(var n in e)if(e.hasOwnProperty(n)&&"function"==typeof e[n]){var r=n.replace("on",""),o=e[n];t.on(r,o)}},w._setupVideoElement=function(e){this._componentEmitter.emit(I.CREATE_VIDEO,{elementId:this._mediaElementId,container:e})},w._onLogicError=function(e){switch(e.data.code){case A.PLAYER.VISIBILITY_HIDDEN:this._setState(p.VISIBILITY_HIDDEN);break;case A.STREAM.NOT_ENOUGH_DATA:this._setState(p.NOT_ENOUGH_DATA);break;case A.STREAM.SOURCE_STOPPED:this._setState(p.SOURCE_STREAM_STOPPED);break;case A.MEDIA.SOURCE_ENDED:this._setState(p.PLAYBACK_ERROR)}this.emit(m.ERROR,e.data),this.pause(this.state)},w._onUpdateSourceInit=function(e){!(d.mustUseHLS||config.playback.allowSafariHlsFallback&&d.canUseHLS)||this.state!==this.STATE.PLAYING&&this.state!==this.STATE.LOADING&&this.state!==this.STATE.BUFFERING?e.data.options.forcePlay&&[this.STATE.READY,this.STATE.PAUSED].indexOf(this.state)!==-1&&setTimeout(this.play.bind(this),200):(this._setState(p.PLAYBACK_RESTARTING),this.pause(this.state),setTimeout(this.play.bind(this),200))},w._onPlayStartError=function(e){switch(this._debug(e.data.error.name+": "+e.data.error.message,1),e.data.error.name){case"NotAllowedError":e.data.automuted?this._emitWarning("Unmuted autoplay failed by autoplay policy, but 'automute' is enabled. Try to play muted."):(this._setState(this.STATE.PLAYBACK_NOT_STARTED),this._emitError(A.PLAYER.INTERACTION_REQUIRED,"Playback must be initialized by user gesture."))}},w._onError=function(e){if(this.state!==this.STATE.PAUSING&&this.state!==this.STATE.PAUSED){var t="",n=e.data.code;switch(n){case MediaError.MEDIA_ERR_ABORTED:t="A fetching process of the media aborted by user";break;case MediaError.MEDIA_ERR_NETWORK:t="An error occurred when downloading media";break;case MediaError.MEDIA_ERR_DECODE:t="An error occurred when decoding media";break;case MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED:t="The received audio/video is not supported";break;default:t="An unknown media error occurred"}this._debug('error media with state "'+this._getState()+'", networkstate "'+this._getNetworkState()+'"',3),this._debug("error message: "+t,3),n===MediaError.MEDIA_ERR_DECODE&&this.state!==this.STATE.LOADING&&setTimeout(this.play.bind(this),1e3),this._setState(this.STATE.PLAYBACK_ERROR),this._emitError(n+3e3,t)}},w._preparePlay=function(e){this._setState(this.STATE.LOADING,{connectDelay:e}),this.emit(m.LOADING,{connectDelay:e}),setTimeout(function(){this.state===this.STATE.LOADING&&(this._componentEmitter.emit(P.PLAY),this._componentEmitter.emit(I.PLAY,{external:!0}))}.bind(this),e)},w.play=function(){var e=arguments.length?arguments[0]:0;L("nanoplayer ("+this._playerDivId+"): play in state "+this.state,1),this.state<this.STATE.READY?this._emitError(A.PLAYER.NOT_CONFIGURED,"Could not play because player has not been configured."):this.state===this.STATE.READY||this.state===this.STATE.PAUSED?(this._playing=!0,this._preparePlay(e)):this.state===this.STATE.PAUSING&&(L("nanoplayer ("+this._playerDivId+"play in PAUSING state, setting flag to resume"),this._resumeOnPause=!0)},w._onConnectionInitializationError=function(e){this._debug('error init connection with state "'+this._getState()+'", networkstate "'+this._getNetworkState()+'"',2),this._setState(this.STATE.CONNECTION_ERROR),this._emitError(e.data.code,e.data.message)},w._onConnectionError=function(e){this._debug('error connection with state "'+this._getState()+'", networkstate "'+this._getNetworkState()+'"',2),this._setState(this.STATE.CONNECTION_ERROR),this._emitError(e.data.code,e.data.message)},w._onConnectionConnecting=function(e){this._debug("connecting",1)},w._onConnectionStateChange=function(e){this.networkState=e.data.connectionState},w._onConnectionWarning=function(e){var t="Connection warning!",n=e?e.data:void 0;n&&n.message&&(t+=" "+n.message),n&&n.code&&(t+=" (code:"+n.code+")"),this._emitWarning(t)},w._onConnectionOpen=function(e){e.data.count?this._debug("connection open after "+e.data.count+" reconnect tries",1):this._debug("connection open",1)},w._onConnectionClosed=function(e){this._debug("connection closed",1),this._debug('closed connection with state "'+this._getState()+'", networkstate "'+this._getNetworkState()+'"',2),this._emitError(e.data.code,e.data.message)},w._onConnectionDestroyed=function(e){this._debug("connection destroyed"+(e.data.silent?", but silent":""),1),this.state===this.STATE.READY||e.data.silent||this.pause(this.state)},w._onConnectionReconnecting=function(e){this._debug("reconnect attempt "+e.data.count+" started",1)},w._onConnectionReconnectionImminent=function(e){var t=e.data.code;this._debug("connection "+e.data.count+(e.data.count>1?" times":" time")+" unexpectedly closed with code "+t+", but a reconnect will be prepared",1),this._debug("reconnect attempt "+e.data.count+" starts in "+Math.round(e.data.delay)+" ms",1),("iOS"!==o.os||"iOS"===o.os&&e.data.count>1)&&this._emitWarning("Connection error: closed "+e.data.count+(e.data.count>1?" times":" time")+" unexpectedly with code "+t+", but a reconnect will be prepared in "+(e.data.delay/1e3).toFixed(3)+" s"),this._playing&&"iOS"!==o.os&&(this._setState(this.STATE.RECONNECTION_IMMINENT),this.pause(this.state),this.play(e.data.delay))},w._onServerInfo=function(e){this._debug("onServerInfo",2);try{this._serverInfo=e.data.onServerInfo;var t=JSON.stringify(e.data);this._debug(""+t,3)}catch(e){}},w._onStreamInfo=function(e){this._debug("onStreamInfo",2),this.emit(m.STREAM_INFO,e.data)},w._onStreamInfoUpdate=function(e){this._debug("onStreamInfoUpdate",2),this.emit(m.STREAM_INFO_UPDATE,e.data)},w._onNoKeepConnection=function(e){this._debug("onNoKeepConnection",2),this._emitWarning(e.data.message)},w._onMimeTypeUnsupported=function(){this._setState(this.STATE.PLAYBACK_ERROR),this._emitError(A.MEDIA.NOT_SUPPORTED,"The received audio/video is not supported")},w._onMediaError=function(e){this._setState(this.STATE.PLAYBACK_ERROR),this._emitError(A.PLAYER.PLAYBACK_ERROR,e.data)},w._onMediaSuspended=function(){o.mobile?(this._setState(this.STATE.PLAYBACK_SUSPENDED),this._emitError(A.PLAYER.PLAYBACK_SUSPENDED,"Playback suspended by external reason.")):(this._setState(p.PLAYBACK_RESTARTING),this.pause(this.state),setTimeout(this.play.bind(this),0))},w._emit=w.emit,w.emit=function(e,t){var n={};t&&t.name&&t.data?n=t:t?(n.data=t,n.name=e||"unknown"):(n.data={},n.name=e||"unknown"),n.player=this._playerDivId,n.id=this.id,n.version=this.version,n.state=this.state,"Error"===e&&n.data.code&&n.data.message&&this._debug("error "+n.data.code+" "+n.data.message,1),this._emit(n.name,n)},w._emitError=function(e,t){this.emit(m.ERROR,{code:e,message:t}),this.pause(this.state)},w._emitWarning=function(e){this.emit(m.WARNING,{message:e})},w._getPauseReason=function(e){var t="";if(e){var n=this.networkState!==this.NETWORK_STATE.OPEN&&this.networkState!==this.NETWORK_STATE.UNINITIALIZED;switch(e){case this.STATE.READY:t=S.SERVER_NOT_FOUND;break;case this.STATE.LOADING:t=n?S.CONNECTION_CLOSE:S.STREAM_NOT_FOUND;break;case this.STATE.BUFFERING:t=n?S.CONNECTION_CLOSE:S.BUFFER;break;case this.STATE.UNKNOWN:t=n?S.CONNECTION_CLOSE:S.UNKNOWN;break;case this.STATE.PLAYING:t=n?S.CONNECTION_CLOSE:S.NORMAL;break;case this.STATE.PLAYBACK_NOT_STARTED:t=S.INTERACTION_REQUIRED;break;case this.STATE.PLAYBACK_SUSPENDED:t=S.PLAYBACK_SUSPENDED;break;case this.STATE.PLAYBACK_ERROR:t=S.PLAYBACK_ERROR;break;case this.STATE.RECONNECTION_IMMINENT:t=S.RECONNECTION_IMMINENT;break;case this.STATE.CONNECTION_ERROR:t=S.CONNECTION_CLOSE;break;case this.STATE.DESTROYING:t=S.DESTROY;break;case this.STATE.PLAYBACK_RESTARTING:t=S.PLAYBACK_RESTART;break;case this.STATE.VISIBILITY_HIDDEN:t=S.VISIBILITY_HIDDEN;break;case this.STATE.NOT_ENOUGH_DATA:t=S.NOT_ENOUGH_DATA;break;case this.STATE.SOURCE_STREAM_STOPPED:t=S.SOURCE_STREAM_STOPPED;break;default:t=S.NORMAL}}else t=S.NORMAL;return t},w._triggerPause=function(){return this.state===this.STATE.PAUSED?void L("nanoplayer ("+this._playerDivId+"): trigger pause but already in state paused"):(L("nanoplayer ("+this._playerDivId+'): trigger pause with reason "'+this._pauseReason+'", state "'+this._getState()+'", networkstate "'+this._getNetworkState()+'"',3),this._setState(this.STATE.PAUSED,{reason:this._pauseReason}),this.emit(m.PAUSE,{reason:this._pauseReason}),void(this._resumeOnPause&&(this._resumeOnPause=!1,this.play())))},w.pause=function(){var e=arguments.length?arguments[0]:0;L("nanoplayer ("+this._playerDivId+"): pause in state "+this.state,2),this.state<this.STATE.READY?this._emitError(A.PLAYER.NOT_PLAYING,"Could not pause because player was not in playing state before."):this.state!==this.STATE.PAUSED&&this.state!==this.STATE.PAUSING&&(this._pauseReason=this._getPauseReason(e),this._setState(this.STATE.PAUSING),this._playing=!1,this._resumeOnPause=!1,this._componentEmitter.emit(P.PAUSE),this._componentEmitter.emit(I.PAUSE),this._triggerPause())},w.mute=function(){this._componentEmitter.emit(I.MUTE)},w.unmute=function(){this._componentEmitter.emit(I.UNMUTE)},w.setVolume=function(e){this._componentEmitter.emit(I.SET_VOLUME,{volume:e})},w.updateSource=function(e,t){return new Promise(function(n,r){if(this._updating)r(new f("Another 'updateSource' call is pending."));else{this._updating=!0;var o=function(e,t){this._updating=!1,e.apply(null,t)}.bind(this);try{var i;if(i=c.validateConfig(U.supportedTechniques[0],{source:e}))i.message.replace("create","update"),this._emitError(i.code,i.message),o(r,[i]);else{a.merge(e,this.config.source),a.clean(this.config.source);var s=this.config.source.h5live.params,u=this.config.source.h5live.rtmp,d=s&&s.url?s.url:u&&u.url?u.url:null,E=s&&s.stream?s.stream:u&&u.streamname?u.streamname:null;d&&E?this.config.url=d+"/"+E:this.config.url="";var l={method:"server",timestampReset:!1,pauseOnError:!1,forcePlay:!0,fastStart:!1,incTiming:!1,timeout:10,tag:""};for(var p in l)if(t.hasOwnProperty(p)&&typeof t[p]==typeof l[p])switch(p){case"method":["server","client"].indexOf(t[p])!==-1?l[p]=t[p]:this._emitWarning("The 'updateSource' method is not valid. Valid methods are 'server' and 'client'. The default method 'server' will be set.");break;case"timeout":t[p]>=5&&t[p]<=30?l[p]=t[p]:this._emitWarning("The 'updateSource' timeout value is not in the valid range. the valid range is between 5 and 30. The default value 10 will be set.");break;default:l[p]=t[p]}this._componentEmitter.emit(I.UPDATE_SOURCE,{source:e,options:l}),o(n,[this.config])}}catch(e){o(r,[new f(e.message,e.code)])}}}.bind(this))},w._parseUrl=function(e){var t={url:"",streamname:""},n=e.lastIndexOf("/"),r=e.substr(0,n),o=e.substr(n,e-n);return t.url=r,t.streamname=o,t},w._getState=function(){return u.findPropertyByValue(this.STATE,this.state)},w._getNetworkState=function(){return u.findPropertyByValue(this.NETWORK_STATE,this.networkState)},w._onMediaPlaying=function(e){var t=this.state;this._setState(p.PLAYING),this.emit(t===p.BUFFERING?m.STOP_BUFFERING:m.PLAY,e.data),this._debug("state is PLAYING")},w._onMediaBuffering=function(){this._setState(p.BUFFERING),this.emit(m.START_BUFFERING)},w.STATE=p,w.NETWORK_STATE=T,w.PAUSE_REASON=S,U}.apply(t,r),!(void 0!==o&&(e.exports=o))},function(e,t,n){var r,o;r=[n(15)],o=function(e){function t(t,n,r){function o(){s=[],r.forEach(function(e){s.push({type:e.from,listener:a}),u[e.from]||(u[e.from]=[]),u[e.from].push(e.to)}),e.add({target:t,listeners:s})}function i(){e.remove({target:t,listeners:s}),s=null,u=null}function a(e){u[e.name]&&u[e.name].forEach(function(t){var r={};for(var o in e)e.hasOwnProperty(o)&&(r[o]=e[o]);n.emit(t,r)})}var s,u={};return o(),{destroy:i}}return{create:t}}.apply(t,r),!(void 0!==o&&(e.exports=o))},function(e,t,n){var r,o;r=[n(16)],o=function(e){"use strict";function t(t){if(!t.target)throw new Error(e.NO_TARGET);if(!t.listeners||!t.listeners.length)throw new Error(e.NO_LISTENERS);if(!n(t.target,i)||!n(t.target,a))throw new Error(e.NOT_DISPATCHER);for(var r=0;r<t.listeners.length;++r)if(!t.listeners[r].type&&"string"!=typeof t.listeners[r].type||0!==t.listeners[r].type.length){if(!t.listeners[r].type)throw new Error(e.MISSING_TYPE.replace("%index%",r));if("function"!=typeof t.listeners[r].listener)throw new Error(e.MISSING_LISTENER.replace("%index%",r))}else t.listeners.splice(r,1),r--}function n(e,t){for(var n=0;n<t.length;++n)if("function"==typeof e[t[n]])return e[t[n]];return null}function r(e,r){t(r),o(n(r.target,e),r.target,r.listeners)}function o(e,t,n){for(var r=0;r<n.length;++r)e.call(t,n[r].type,n[r].listener)}var i=["addEventListener","addListener","on"],a=["removeEventListener","removeListener","off"];return{add:r.bind(null,i),remove:r.bind(null,a)}}.apply(t,r),!(void 0!==o&&(e.exports=o))},function(e,t,n){var r,o;r=[],o=function(){return Object.freeze({NO_TARGET:"No target in config",NO_LISTENERS:"No listeners in config",NOT_DISPATCHER:"Target is not an event dispatcher",MISSING_TYPE:"Missing type in listener #%index%",MISSING_LISTENER:"Missing/invalid listener in listener #%index%"})}.apply(t,r),!(void 0!==o&&(e.exports=o))},function(e,t,n){var r,o;r=[],o=function(){return{CORE:"4.0.6"}}.apply(t,r),!(void 0!==o&&(e.exports=o))},function(e,t,n){var r,o;r=[],o=function(){var e=function(){function e(){var e=isNaN(n("debug"))?0:+n("debug"),r=+t("nanoDebug");return Math.max(e,r)}function t(e){return document.cookie.indexOf(e+"=")!==-1?document.cookie.split(e+"=")[1].split(";")[0]:null}function n(e){if(!i){i=[];var t=document.location.search.substr(1,document.location.search.length);if(""===t&&document.location.href.indexOf("?")!==-1){var n=document.location.href.indexOf("?")+1;t=document.location.href.slice(n)}if(""!==t)for(var r=t.split("&"),o=0;o<r.length;++o){var a="",s=r[o].split("="),u=s[0];s.length>1&&(a=s[1]),i[decodeURIComponent(u)]=decodeURIComponent(a)}}try{return i[e]}catch(e){return}}function r(){return(new Date).toISOString()}var o=e(),i=void 0;setInterval(function(){o=e()},5e3);var a=function(e,t){try{o>=t&&console.debug(r()+": "+e)}catch(e){}};return{log:a,getHTTPParam:n}}();return e}.apply(t,r),!(void 0!==o&&(e.exports=o))},function(e,t,n){var r,o;r=[n(11),n(20),n(21)],o=function(e,t,n){function r(e,t){var n;for(n in e)e.hasOwnProperty(n)&&t.hasOwnProperty(n)&&("object"!=typeof e[n]||!Object.keys(e[n]).length||"object"==typeof t[n]&&Object.keys(t[n]).length?"object"==typeof e[n]?r(e[n],t[n]):t[n]=e[n]:o(e[n],t[n]))}function o(e,t){var n;for(n in e)e.hasOwnProperty(n)&&(!t[n]&&(t[n]={}),"object"==typeof e[n]?o(e[n],t[n]):t[n]=e[n])}function i(e){var t;for(t in e)e.hasOwnProperty(t)&&("undefined"==typeof e[t]||"string"==typeof e[t]&&0===e[t].length)&&delete e[t],e.hasOwnProperty(t)&&e[t]instanceof Object&&i(e[t]);for(t in e)(e.hasOwnProperty(t)&&("undefined"==typeof e[t]||"string"==typeof e[t]&&0===e[t].length)||"object"==typeof e[t]&&"function"!=typeof e[t]&&0===Object.keys(e[t]).length)&&delete e[t]}function a(e,t,n,r){n=n||"",r=r||[];var o;for(o in e)e.hasOwnProperty(o)&&t.hasOwnProperty(o)&&("object"==typeof e[o]&&"object"==typeof t[o]?r=a(e[o],t[o],n+o+".",r):typeof e[o]!==t[o]&&"*"!==t[o]&&void 0!==e[o]&&""!==e[o]&&r.push("Configuration warning. The config property '$property$' must be of type '$type$'.".replace("$property$",n+o).replace("$type$",t[o]))),e.hasOwnProperty(o)&&!t.hasOwnProperty(o)&&r.push("Configuration warning. The config property '$property$' is not a valid property. Please remove from config.".replace("$property$",n+o));return r}return{merge:r,clean:i,check:a,extend:o}}.apply(t,r),!(void 0!==o&&(e.exports=o))},function(e,t,n){var r,o;r=[],o=function(){return Object.freeze({CONFIG_RTMP:"Configuration error. Could not create player, the rtmp configuration is missing or incomplete. Add an rtmp url and streamname to the configuration.",CONFIG_TOKEN:"Configuration error. Could not create player, with this configuration an security token is required. Add an token to the configuration.",CONFIG_WSS:"Configuration error. Could not create player, the websocket server configuration is missing.",CONFIG_HLS:"Configuration error. Could not create player, the hls server configuration is missing.",CONFIG_METADATA:"Configuration error. Could not create player, the websocket server configuration for metadata is missing.",CONFIG_SOURCE:"The players source configuration is malformed or missing, please check documentation for more information or contact us."})}.apply(t,r),!(void 0!==o&&(e.exports=o))},function(e,t,n){var r,o;r=[],o=function(){return Object.freeze({PLAYER:{NO_RTMP_URL_SET:1001,NO_SERVER_SET:1002,NOT_CONFIGURED:1003,NOT_PLAYING:1004,INTERACTION_REQUIRED:1005,BUFFER_CONFIG_INVALID:1006,PLAYBACK_SUSPENDED:1007,PLAYBACK_ERROR:1008,VISIBILITY_HIDDEN:1009},STREAM:{NOT_FOUND:2001,MEDIA_NOT_AVAILABLE:2002,NOT_ENOUGH_DATA:2003,SOURCE_STOPPED:2004,METADATA_STILL_PROCESSING:2014,METADATA_NO_START_INDEX:2013,METADATA_INVALID_JSON:2012,METADATA_WRONG_INDEX:2011},MEDIA:{ABORTED:3001,
DOWNLOAD_ERROR:3002,DECODE_ERROR:3003,NOT_SUPPORTED:3004,MEDIA_SOURCE_ENDED:3100},NETWORK:{COULD_NOT_ESTABLISH_CONNECTION:4001,CONNECTION_ERROR:4002,MAX_RECONNECTS_REACHED:4003,RECONNECTION_CONFIG_INVALID:4004,UPDATE_SOURCE_STREAM_STOPPED:4005,UPDATE_SOURCE_TIMEOUT:4006},SETUP:{EXCEPTION:5001,CLIENT_NOT_SUPPORTED:5002,FORCE_NOT_SUPPORTED:5003,SOURCE_NOT_SUPPORTED:5004,CONFIG_RTMP:5005,CONFIG_TOKEN:5006,CONFIG_WSS:5007,CONFIG_HLS:5008,CONFIG_METADATA:5009,EMBED_PLAYER:5010}})}.apply(t,r),!(void 0!==o&&(e.exports=o))},function(e,t,n){var r,o;r=[],o=function(){function e(t){var r;switch(typeof t){case"object":if(null===t)r=null;else switch(n.call(t)){case"[object Array]":r=t.map(e);break;case"[object Date]":r=new Date(t);break;case"[object RegExp]":r=new RegExp(t);break;default:r=Object.keys(t).reduce(function(n,r){return n[r]=e(t[r]),n},{})}break;default:r=t}return r}function t(e,t){if("object"==typeof e)for(var n in e)if(e[n]===t)return n;return!1}var n=Object.prototype.toString;return{copy:e,findPropertyByValue:t}}.apply(t,r),!(void 0!==o&&(e.exports=o))},function(e,t,n){var r,o;r=[n(11),n(20),n(24),n(21)],o=function(e,t,n,r){function o(o,i){var a=i.source;if(!a||!a.h5live)return new e(t.CONFIG_SOURCE,r.SETUP.SOURCE_NOT_SUPPORTED);var s=i.source.h5live;if(!(s.rtmp&&s.rtmp.url&&s.rtmp.streamname||s.params))return new e(t.CONFIG_RTMP,r.SETUP.CONFIG_RTMP);if(o===n.H5LIVE_WSS&&(!s.server||s.server&&!s.server.websocket))return new e(t.CONFIG_WSS,r.SETUP.CONFIG_WSS);if(o===n.H5LIVE_HLS){if(!s.server||s.server&&!s.server.hls)return new e(t.CONFIG_HLS,r.SETUP.CONFIG_HLS);if(i.playback&&i.playback.metadata&&!s.server.websocket)return new e(t.CONFIG_METADATA,r.SETUP.CONFIG_METADATA)}return!(s.server&&(s.server.websocket||s.server.hls)||s.token)&&new e(t.CONFIG_TOKEN,r.SETUP.CONFIG_TOKEN)}function i(t){if(!("string"==typeof t||t instanceof String))throw new e('The param "playerDivId" must be of type "String".');var n=document.getElementById(t);if(!n)throw new e('The param "playerDivId" must be the id of an existing "div" element.');if("DIV"!==n.tagName)throw new e('The element with the id "'+t+'" is not a "div" element.');return!0}return{validateConfig:o,validatePlayerDivId:i}}.apply(t,r),!(void 0!==o&&(e.exports=o))},function(e,t,n){var r,o;r=[],o=function(){return Object.freeze({FLASH:"flash",NATIVE:"hls.native",H5LIVE_WSS:"h5live",H5LIVE_HLS:"h5live.hls"})}.apply(t,r),!(void 0!==o&&(e.exports=o))},function(e,t,n){var r,o;r=[n(10),n(26)],o=function(e,t){var n=t.create("Conditions"),r=e.os,o=e.osVersion,i=e.browser,a=parseInt(e.browserVersion.split(".")[0],10),s=e.browserEngine,u="Microsoft Edge Trident"===i,c="Microsoft Internet Explorer"===i||u,d="Chromium"===s&&a>57,f="iOS"===r,E=f&&a>=11,l="Mac OS X"===r,p="Firefox"===i,T="Safari"===i,m=T&&12.1===parseFloat(e.browserVersion)&&"iOS"!==r,A=f&&parseInt(o)>=10,_=m,S="iOS"!==r&&!!window.MediaSource&&(p&&a>=48||u||window.MediaSource.isTypeSupported&&window.MediaSource.isTypeSupported('video/mp4; codecs="avc1.42E01E, mp4a.40.2"')),h=function(){var e=!1;try{("Chrome"===i||"Chromium"===i)&&a<54?e=!0:"Firefox"===i&&a<48?e=!0:"Microsoft Internet Explorer"===i&&(a<11||11===a&&7===parseInt(o))?e=!0:"Safari"===i&&a<10&&(e=!0)}catch(e){}return e}();!A&&!S&&l&&T&&a>=10&&(A=!0);var R={mustUseHLS:A,canUseHLS:_,isTridentBrowser:c,useFakeAudio:d,hasMediaSource:S,isIOS:f,isIOS11:E,isFirefox:p,isSafari:T,isSafari121MacOSX:m,isH5LiveKnownUnsupported:h};for(var O in R)R.hasOwnProperty(O)&&n.debug(O+": "+R[O]);return R}.apply(t,r),!(void 0!==o&&(e.exports=o))},function(e,t,n){var r,o;r=[n(18)],o=function(e){function t(t,n,r){e.log("["+n+"] "+r,t)}function n(e){return{debug:t.bind(this,a,e),info:t.bind(this,i,e),warn:t.bind(this,o,e),error:t.bind(this,r,e),detail:t.bind(this,s,e)}}var r=0,o=1,i=2,a=3,s=4;return{create:n}}.apply(t,r),!(void 0!==o&&(e.exports=o))},function(e,t,n){var r,o;r=[],o=function(){return Object.freeze({UNINITIALIZED:1,CONNECTING:2,OPEN:3,CLOSING:4,CLOSED:5})}.apply(t,r),!(void 0!==o&&(e.exports=o))},function(e,t,n){var r,o;r=[n(15),n(7),n(29),n(30),n(31),n(32),n(26)],o=function(e,t,n,r,o,i,a){function s(n){function r(){e.add({target:n,listeners:d})}function i(){e.remove({target:n,listeners:d})}function s(e,t){n.emit(e,t)}function u(e){c=e.data.state,s(t.STATE_CHANGE,e.data)}var c,d=(a.create("StateMachine"),[{type:o.STATE_CHANGE,listener:u}]);return r(),{destroy:i}}return{create:s}}.apply(t,r),!(void 0!==o&&(e.exports=o))},function(e,t,n){var r,o;r=[],o=function(){var e="control.";return{BASE:e,CONNECT:e+"connect",DISCONNECT:e+"disconnect",NETWORK_PLAY:e+"networkPlay",NETWORK_PAUSE:e+"networkPause",PLAY:e+"play",PAUSE:e+"pause",MUTE:e+"mute",UNMUTE:e+"unmute",SET_VOLUME:e+"setVolume",SEEK:e+"seek",SET_RATE:e+"playbackRate",CONFIG:e+"config",CREATE_VIDEO:e+"createVideo",DESTROY_VIDEO:e+"destroyVideo",VIDEO_SOURCE:e+"videoSource",UPDATE_SOURCE:e+"updateSource",NETWORK_UPDATE_SOURCE:e+"networkUpdateSource"}}.apply(t,r),!(void 0!==o&&(e.exports=o))},function(e,t,n){var r,o;r=[],o=function(){var e="media.";return{BASE:e,LOAD_START:e+"loadstart",PROGRESS:e+"progress",SUSPEND:e+"suspend",ABORT:e+"abort",EMPTIED:e+"emptied",STALLED:e+"stalled",PLAY:e+"play",PAUSE:e+"pause",LOADED_META_DATA:e+"loadedmetadata",LOADED_DATA:e+"loadeddata",WAITING:e+"waiting",ERROR:e+"error",PLAYING:e+"playing",CAN_PLAY:e+"canplay",CAN_PLAY_THROUGH:e+"canplaythrough",SEEKING:e+"seeking",SEEKED:e+"seeked",TIME_UPDATE:e+"timeupdate",ENDED:e+"ended",RATE_CHANGE:e+"ratechange",DURATION_CHANGE:e+"durationchange",VOLUME_CHANGE:e+"volumechange",ELEMENT_CREATED:e+"elementCreated",QUALITY_STATS:e+"qualitystats",PLAY_STATS:e+"playStats",FRAME_DROP:e+"framedrop",PLAYBACK_FINISHED:e+"playbackFinished",PLAYBACK_ERROR:e+"playbackError",PLAYBACK_STARTED:e+"playbackStarted",PLAYBACK_SUSPENDED:e+"playbackSuspended",BUFFERING:e+"buffering",PLAY_START_SUCCESS:e+"playStartSuccess",PLAY_START_ERROR:e+"playStartError",BUFFER_TWEAKS_CREATED:e+"bufferTweaksCreated",BUFFER_TWEAKS_ERROR:e+"bufferTweaksError",VIEWPORT_VISIBLE:e+"viewportvisible",VIEWPORT_HIDDEN:e+"viewporthidden"}}.apply(t,r),!(void 0!==o&&(e.exports=o))},function(e,t,n){var r,o;r=[],o=function(){var e="logic.";return{BASE:e,STATE_CHANGE:e+"stateChange",LOADING_TIMEOUT:e+"loadingTimeout",BUFFERING_TIMEOUT:e+"bufferingTimeout",STREAM_INFO:e+"streamInfo",STREAM_INFO_UPDATE:e+"streamInfoUpdate",SERVER_INFO:e+"serverInfo",STREAM_URL:e+"streamUrl",NO_KEEP_CONNECTION:e+"noKeepConnection",MIME_TYPE_UNSUPPORTED:e+"mimeTypeUnsupported",META_DATA_RECEIVED:e+"metaDataReceived",META_DATA_ERROR:e+"metaDataError",NO_SERVER_ERROR:e+"noServerError",MISSING_RTMP_ERROR:e+"missingRtmpError",STARTUP_STATS:e+"startupStats",DOCUMENT_VISIBLE:e+"documentVisible",DOCUMENT_HIDDEN:e+"documentHidden",ERROR:e+"error",UPDATE_SOURCE_INIT:e+"updateSourceInit",UPDATE_SOURCE_SUCCESS:e+"updateSourceSuccess",UPDATE_SOURCE_FAIL:e+"updateSourceFail",UPDATE_SOURCE_ABORT:e+"updateSourceAbort"}}.apply(t,r),!(void 0!==o&&(e.exports=o))},function(e,t,n){var r,o;r=[],o=function(){var e="network.";return{BASE:e,CONNECTING:e+"connecting",CONNECTED:e+"connected",DISCONNECTED:e+"disconnected",RESUMING:e+"resuming",RECONNECTION_IMMINENT:e+"reconnectionImminent",RECONNECTING:e+"reconnecting",RECONNECTION_CONFIG_INVALID:e+"reconnectionConfigInvalid",CONNECTION_ERROR:e+"connectionError",INITIALIZATION_ERROR:e+"initializationError",ERROR:e+"error",WARNING:e+"warning",DESTROYED:e+"destroyed",STATE_CHANGE:e+"stateChange",META_DATA:e+"metaData",SERVER_INFO:e+"serverInfo",STREAM_INFO:e+"streamInfo",STREAM_INFO_UPDATE:e+"streamInfoUpdate",STREAM_FRAGMENT:e+"streamFragment",RANDOM_ACCESS_POINT:e+"randomAccessPoint",RAW_PACKET:e+"raw",STREAM_STATUS:e+"streamStatus",UPDATE_SOURCE_SUCCESS:e+"updateSourceSuccess",UPDATE_SOURCE_FAIL:e+"updateSourceFail",UPDATE_SOURCE_ABORT:e+"updateSourceAbort"}}.apply(t,r),!(void 0!==o&&(e.exports=o))},function(e,t,n){var r,o;r=[n(15),n(21),n(7),n(29),n(30),n(31),n(32),n(26)],o=function(e,t,n,r,o,i,a,s){function u(r){function u(){e.add({target:r,listeners:v}),y.forEach(function(e){r.addListener(e.event,f)})}function c(){e.remove({target:r,listeners:v}),y.forEach(function(e){r.removeListener(e.event,f)})}function d(e,t){r.emit(e,t)}function f(e){var t,n;y.forEach(function(r){r.event===e.name&&(t=r.code?r.code:e.data.code,n=r.message?r.message:e.data.reason,r.defer?setTimeout(E.bind(this,t,n),0):E(t,n))})}function E(e,t){d(n.ERROR,{code:e,message:t})}function l(e){var t;O&&O.quality&&(t=O.quality),O=e.data.stats,t&&!O.quality&&(O.quality=t);var r,o="stats error";try{o=JSON.stringify(O),r=JSON.parse(o),delete r.buffer.update,delete r.buffer.delay.before}catch(e){}d(n.STATS,{stats:r})}function p(e){O||(O={}),O.quality=e.data}function T(e){d(n.PLAYBACK_FINISHED)}function m(e){e.data.muted!==N?(N=e.data.muted,d(N?n.MUTE:n.UNMUTE,{volume:g})):e.data.volume!==g&&(g=e.data.volume,d(n.VOLUME_CHANGE,{volume:g}))}function A(e){setTimeout(d.bind(this,n.METADATA,e.data),0)}function _(e){setTimeout(d.bind(this,n.UPDATE_SOURCE_INIT,e.data),0)}function S(e){setTimeout(d.bind(this,n.UPDATE_SOURCE_SUCCESS,e.data),0)}function h(e){setTimeout(d.bind(this,n.UPDATE_SOURCE_FAIL,e.data),0)}function R(e){setTimeout(d.bind(this,n.UPDATE_SOURCE_ABORT,e.data),0)}var O,g=(s.create("FacadePropagator"),1),N=!1,v=[{type:o.VOLUME_CHANGE,listener:m},{type:o.QUALITY_STATS,listener:p},{type:o.PLAY_STATS,listener:l},{type:o.PLAYBACK_FINISHED,listener:T},{type:i.META_DATA_RECEIVED,listener:A},{type:i.UPDATE_SOURCE_INIT,listener:_},{type:i.UPDATE_SOURCE_SUCCESS,listener:S},{type:i.UPDATE_SOURCE_FAIL,listener:h},{type:i.UPDATE_SOURCE_ABORT,listener:R}],y=[{event:i.META_DATA_ERROR,code:null,message:null,defer:!0},{event:i.MISSING_RTMP_ERROR,code:t.PLAYER.NO_RTMP_URL_SET,message:"No rtmp url set.",defer:!1},{event:i.NO_SERVER_ERROR,code:t.PLAYER.NO_SERVER_SET,message:"No server set.",defer:!1},{event:a.RECONNECTION_CONFIG_INVALID,code:t.NETWORK.RECONNECTION_CONFIG_INVALID,message:null,defer:!0},{event:o.BUFFER_TWEAKS_ERROR,code:t.PLAYER.BUFFER_CONFIG_INVALID,message:null,defer:!1}];return u(),{destroy:c}}return{create:u}}.apply(t,r),!(void 0!==o&&(e.exports=o))},function(e,t,n){var r,o;r=[n(35),n(26),n(25),n(15),n(8),n(29),n(30),n(32),n(31)],o=function(e,t,n,r,o,i,a,s,u){function c(t,c){function h(){r.add({target:t,listeners:G})}function R(){r.remove({target:t,listeners:G}),r.remove({target:t,listeners:U?x:k})}function O(e){U=n.mustUseHLS||e.data.config.playback.allowSafariHlsFallback&&n.canUseHLS,r.add({target:t,listeners:U?x:k})}function g(e){switch(L=e.data.state){case o.PAUSED:M={},F=null}}function N(t){var n=[d,c,t].join(f);e&&"function"==typeof e.mark&&w.indexOf(n)===-1&&(e.mark(n),w.push(n)),M[t]||t===_&&(t!==_||[T,m,A].indexOf(F)===-1)||(F=t,M[t]=e.now(),S.debug(t+": "+M[t]),t===_&&v())}function v(){if(E.forEach(function(e,t){if(void 0===M[e]){M[e]=0;for(var n=t+1,r=E.length;n<r;n+=1)if(void 0!==M[E[n]]){M[e]=M[E[n]];break}}}),E.filter(function(e){return void 0!==M[e]}).length){var e=M[l];for(var n in M)M.hasOwnProperty(n)&&(M[n]=Math.round(M[n]-e));t.emit(u.STARTUP_STATS,{stats:M}),S.debug("startup stats: "+JSON.stringify(M))}}function y(){N(l)}function I(){N(p)}function C(){N(A)}function b(){N(_)}function D(){N(T)}function P(){N(m)}var U,L,w=[],M={},F=null,G=[{type:u.STATE_CHANGE,listener:g},{type:i.CONFIG,listener:O}],k=[{type:s.CONNECTING,listener:y},{type:s.CONNECTED,listener:I},{type:s.STREAM_FRAGMENT,listener:D},{type:a.LOADED_DATA,listener:P},{type:a.CAN_PLAY_THROUGH,listener:C},{type:a.PLAYING,listener:b}],x=[{type:a.PLAY,listener:y},{type:a.DURATION_CHANGE,listener:I},{type:a.LOADED_META_DATA,listener:D},{type:a.LOADED_DATA,listener:P},{type:a.CAN_PLAY_THROUGH,listener:C},{type:a.PLAYING,listener:b}];return h(),{destroy:R}}var d="nano",f=".",E=[],l=E[0]="connecting",p=E[1]="connected",T=E[2]="firstFragmentReceived",m=E[3]="firstFrameRendered",A=E[4]="playable",_=E[5]="playing",S=t.create("Performance");return{create:c}}.apply(t,r),!(void 0!==o&&(e.exports=o))},function(e,t,n){var r,o;r=[],o=function(){var e=Date.now?Date.now():+new Date,t=window.performance||{},n=[],r={},o=function(e,t){for(var r=0,o=n.length,i=[];r<o;r++)n[r][e]===t&&i.push(n[r]);return i},i=function(e,t){for(var r,o=n.length;o--;)r=n[o],r.entryType!==e||void 0!==t&&r.name!==t||n.splice(o,1)};return t.now||(t.now=t.webkitNow||t.mozNow||t.msNow||function(){return(Date.now?Date.now():+new Date)-e}),t.mark||(t.mark=t.webkitMark||function(e){var o={name:e,entryType:"mark",startTime:t.now(),duration:0};n.push(o),r[e]=o}),t.measure||(t.measure=t.webkitMeasure||function(e,t,o){t=r[t].startTime,o=r[o].startTime,n.push({name:e,entryType:"measure",startTime:t,duration:o-t})}),t.getEntriesByType||(t.getEntriesByType=t.webkitGetEntriesByType||function(e){return o("entryType",e)}),t.getEntriesByName||(t.getEntriesByName=t.webkitGetEntriesByName||function(e){return o("name",e)}),t.clearMarks||(t.clearMarks=t.webkitClearMarks||function(e){i("mark",e)}),t.clearMeasures||(t.clearMeasures=t.webkitClearMeasures||function(e){i("measure",e)}),void 0===window.performance&&(window.performance=t),window.performance}.apply(t,r),!(void 0!==o&&(e.exports=o))},function(e,t,n){var r,o;r=[n(15),n(21),n(37),n(7),n(8),n(29),n(30),n(31),n(32),n(26),n(10)],o=function(e,t,n,r,o,i,a,s,u,c,d){function f(r){function i(){e.add({target:r,listeners:v})}function d(){e.remove({target:r,listeners:v})}function f(e,t){r.emit(e,t)}function E(e,r){f(s.ERROR,{code:t[e][r],message:n[e][r]})}function l(e){h=e.data.state,h===o.LOADING&&(O=!1,R=null)}function p(e){O?E("STREAM","NOT_ENOUGH_DATA"):R&&"stopped"===R?E("STREAM","SOURCE_STOPPED"):E("STREAM","NOT_FOUND")}function T(e){R&&"stopped"===R?E("STREAM","SOURCE_STOPPED"):E("STREAM","MEDIA_NOT_AVAILABLE")}function m(e){O=!0}function A(e){e.name===s.DOCUMENT_HIDDEN?g=!0:(g&&(N=!0),g=!1,setTimeout(function(e){N=!1},1e3))}function _(e){g||N?E("PLAYER","VISIBILITY_HIDDEN"):E("MEDIA","MEDIA_SOURCE_ENDED")}function S(e){R=e.data.onStreamStatus.status}var h,R,O,g,N,v=(c.create("ErrorSelector"),[{type:s.STATE_CHANGE,listener:l},{type:s.LOADING_TIMEOUT,listener:p},{type:s.BUFFERING_TIMEOUT,listener:T},{type:s.STREAM_INFO,listener:m},{type:s.DOCUMENT_VISIBLE,listener:A},{type:s.DOCUMENT_HIDDEN,listener:A},{type:a.PLAYBACK_FINISHED,listener:_},{type:u.STREAM_STATUS,listener:S}]);return i(),{destroy:d}}return{create:f}}.apply(t,r),!(void 0!==o&&(e.exports=o))},function(e,t,n){var r,o;r=[],o=function(){return Object.freeze({PLAYER:{VISIBILITY_HIDDEN:"Playback failed because the player was in visibility state 'hidden' at load start."},STREAM:{NOT_FOUND:"The requested stream can not be found.",MEDIA_NOT_AVAILABLE:"No media available.",NOT_ENOUGH_DATA:"Not enough media data received.",SOURCE_STOPPED:"The source stream has been stopped."},MEDIA:{MEDIA_SOURCE_ENDED:"The media source extension changed the state to 'ended'."},NETWORK:{UPDATE_SOURCE_STREAM_STOPPED:"The requested source stream in the 'updateSource' call has been stopped.",UPDATE_SOURCE_TIMEOUT:"The update source request was aborted by timeout."}})}.apply(t,r),!(void 0!==o&&(e.exports=o))},function(e,t,n){var r,o;r=[n(26),n(4),n(25),n(15),n(14),n(40),n(29),n(31),n(30),n(32),n(41),n(42),n(39),n(43),n(44),n(45),n(46),n(47),n(49),n(50),n(51),n(53),n(54),n(55)],o=function(e,t,n,r,o,i,a,s,u,c,d,f,E,l,p,T,m,A,_,S,h,R,O,g){"use strict";function N(N){function v(){P.debug("init"),C=o.create(N,D,w),b=o.create(D,N,L),r.add({target:D,listeners:M}),U.push(A.create(D)),U.push(R.create(D)),U.push(h.create(D)),U.push(g.create(D))}function y(){for(C.destroy(),C=null,b.destroy(),b=null;U.length;)U.pop().destroy();r.remove({target:D,listeners:M})}function I(e){U.push(n.mustUseHLS||e.data.config.playback.allowSafariHlsFallback&&n.canUseHLS?S.create(D):_.create(D)),e.data.config.playback.metadata&&U.push(O.create(D))}var C,b,D=new t,P=e.create("LogicManager"),U=[],L=[{from:d.SEEK,to:a.SEEK},{from:d.RATE,to:a.SET_RATE},{from:f.CONNECT,to:a.CONNECT},{from:f.DISCONNECT,to:a.DISCONNECT},{from:f.VIDEO_SOURCE,to:a.VIDEO_SOURCE},{from:f.NETWORK_PLAY,to:a.NETWORK_PLAY},{from:f.NETWORK_UPDATE_SOURCE,to:a.NETWORK_UPDATE_SOURCE},{from:f.NO_SERVER_ERROR,to:s.NO_SERVER_ERROR},{from:f.MISSING_RTMP_ERROR,to:s.MISSING_RTMP_ERROR},{from:f.NO_KEEP_CONNECTION,to:s.NO_KEEP_CONNECTION},{from:f.SERVER_INFO,to:s.SERVER_INFO},{from:f.URL,to:s.STREAM_URL},{from:f.UPDATE_SOURCE_INIT,to:s.UPDATE_SOURCE_INIT},{from:f.UPDATE_SOURCE_SUCCESS,to:s.UPDATE_SOURCE_SUCCESS},{from:f.UPDATE_SOURCE_FAIL,to:s.UPDATE_SOURCE_FAIL},{from:f.UPDATE_SOURCE_ABORT,to:s.UPDATE_SOURCE_ABORT},{from:l.LOADING_TIMEOUT,to:s.LOADING_TIMEOUT},{from:l.BUFFERING_TIMEOUT,to:s.BUFFERING_TIMEOUT},{from:p.CREATED,to:s.STREAM_INFO},{from:p.UPDATED,to:s.STREAM_INFO_UPDATE},{from:p.MIME_TYPE_UNSUPPORTED,to:s.MIME_TYPE_UNSUPPORTED},{from:T.RECEIVED,to:s.META_DATA_RECEIVED},{from:T.ERROR,to:s.META_DATA_ERROR},{from:m.VISIBLE,to:s.DOCUMENT_VISIBLE},{from:m.HIDDEN,to:s.DOCUMENT_HIDDEN}],w=[{from:i.PLAY,to:E.API_PLAY},{from:i.PAUSE,to:E.API_PAUSE},{from:u.BUFFER_TWEAKS_CREATED,to:E.BUFFER_TWEAKS_CREATED},{from:u.PLAY_STATS,to:E.PLAY_STATS},{from:u.PLAYBACK_STARTED,to:E.PLAYING},{from:u.BUFFERING,to:E.BUFFERING},{from:u.CAN_PLAY,to:E.CAN_PLAY},{from:u.FRAME_DROP,to:E.FRAME_DROP},{from:u.VIEWPORT_VISIBLE,to:E.VIEWPORT_VISIBLE},{from:u.VIEWPORT_HIDDEN,to:E.VIEWPORT_HIDDEN},{from:c.CONNECTING,to:E.NETWORK_CONNECTING},{from:c.CONNECTED,to:E.NETWORK_CONNECTED},{from:c.DISCONNECTED,to:E.NETWORK_DISCONNECTED},{from:c.DESTROYED,to:E.NETWORK_DISCONNECTED},{from:c.RECONNECTING,to:E.NETWORK_RECONNECTING},{from:c.RECONNECTION_IMMINENT,to:E.NETWORK_RECONNECTION_IMMINENT},{from:c.INITIALIZATION_ERROR,to:E.NETWORK_INITIALIZATION_ERROR},{from:c.ERROR,to:E.NETWORK_ERROR},{from:c.STATE_CHANGE,to:E.NETWORK_STATE_CHANGE},{from:c.RANDOM_ACCESS_POINT,to:E.RANDOM_ACCESS_POINT},{from:c.SERVER_INFO,to:E.SERVER_INFO},{from:c.STREAM_INFO,to:E.STREAM_INFO},{from:c.STREAM_INFO_UPDATE,to:E.STREAM_INFO_UPDATE},{from:c.META_DATA,to:E.META_DATA},{from:c.UPDATE_SOURCE_SUCCESS,to:E.UPDATE_SOURCE_SUCCESS},{from:c.UPDATE_SOURCE_FAIL,to:E.UPDATE_SOURCE_FAIL},{from:c.UPDATE_SOURCE_ABORT,to:E.UPDATE_SOURCE_ABORT},{from:s.STATE_CHANGE,to:E.APPLICATION_STATE_CHANGE},{from:s.STREAM_URL,to:E.STREAM_URL},{from:a.CONFIG,to:E.CONFIG},{from:a.UPDATE_SOURCE,to:E.UPDATE_SOURCE}],M=[{type:E.CONFIG,listener:I}];return v(),{destroy:y}}return{create:N}}.apply(t,r),!(void 0!==o&&(e.exports=o))},function(e,t,n){var r,o;r=[],o=function(){var e="logicManager.";return{BASE:e,API_PLAY:e+"apiPlay",API_PAUSE:e+"apiPause",NETWORK_CONNECTING:e+"networkConnecting",NETWORK_CONNECTED:e+"networkConnected",NETWORK_DISCONNECTED:e+"networkDisconnected",NETWORK_RECONNECTION_IMMINENT:e+"networkReconnectionImminent",NETWORK_RECONNECTING:e+"networkReconnecting",NETWORK_CONNECTION_ERROR:e+"networkConnectionError",NETWORK_INITIALIZATION_ERROR:e+"networkInitializationError",NETWORK_MAX_RETRY_REACHED:e+"networkMaxRetryReached",NETWORK_ERROR:e+"networkError",NETWORK_STATE_CHANGE:e+"networkStateChange",SERVER_INFO:e+"serverInfo",STREAM_INFO:e+"streamInfo",STREAM_INFO_UPDATE:e+"streamInfoUpdate",STREAM_FRAGMENT:e+"streamFragment",RANDOM_ACCESS_POINT:e+"randomAccessPoint",STREAM_URL:e+"streamUrl",CONFIG:e+"config",BUFFER_TWEAKS_CREATED:e+"tweaksCreated",PLAYING:e+"playing",BUFFERING:e+"buffering",PLAY_STATS:e+"playStats",APPLICATION_STATE_CHANGE:e+"applicationStateChange",CAN_PLAY:e+"canPlay",META_DATA:e+"metaData",UPDATE_SOURCE:e+"updateSource",FRAME_DROP:e+"frameDrop",VIEWPORT_VISIBLE:e+"viewportvisible",VIEWPORT_HIDDEN:e+"viewporthidden",UPDATE_SOURCE_SUCCESS:e+"updateSourceSuccess",UPDATE_SOURCE_FAIL:e+"updateSourceFail",UPDATE_SOURCE_ABORT:e+"updateSourceAbort"}}.apply(t,r),!(void 0!==o&&(e.exports=o))},function(e,t,n){var r,o;r=[],o=function(){var e="api.";return{PLAY:e+"play",PAUSE:e+"pause"}}.apply(t,r),!(void 0!==o&&(e.exports=o))},function(e,t,n){var r,o;r=[],o=function(){var e="liveBufferControl.";return{BASE:e,SEEK:e+"seek",RATE:e+"rate"}}.apply(t,r),!(void 0!==o&&(e.exports=o))},function(e,t,n){var r,o;r=[],o=function(){var e="connection.";return{BASE:e,CONNECT:e+"connect",DISCONNECT:e+"disconnect",VIDEO_SOURCE:e+"videoSource",NETWORK_PLAY:e+"networkPlay",NO_SERVER_ERROR:e+"noServerError",MISSING_RTMP_ERROR:e+"missingRtmpError",SERVER_INFO:e+"serverInfo",NO_KEEP_CONNECTION:e+"noKeepConnection",URL:e+"url",NETWORK_UPDATE_SOURCE:e+"networkUpdateSource",UPDATE_SOURCE_INIT:e+"updateSourceInit",UPDATE_SOURCE_SUCCESS:e+"updateSourceSuccess",UPDATE_SOURCE_FAIL:e+"updateSourceFail",UPDATE_SOURCE_ABORT:e+"updateSourceAbort"}}.apply(t,r),!(void 0!==o&&(e.exports=o))},function(e,t,n){var r,o;r=[],o=function(){var e="timeout.";return{BASE:e,LOADING_TIMEOUT:e+"loadingTimeout",BUFFERING_TIMEOUT:e+"bufferingTimeout"}}.apply(t,r),!(void 0!==o&&(e.exports=o))},function(e,t,n){var r,o;r=[],o=function(){var e="streamInfo.";return{BASE:e,CREATED:e+"created",UPDATED:e+"updated",MIME_TYPE_UNSUPPORTED:e+"mimetypeUnsupported"}}.apply(t,r),!(void 0!==o&&(e.exports=o))},function(e,t,n){var r,o;r=[],o=function(){var e="metaData.";return{BASE:e,RECEIVED:e+"received",ERROR:e+"error"}}.apply(t,r),!(void 0!==o&&(e.exports=o))},function(e,t,n){var r,o;r=[],o=function(){var e="visibility.";return{BASE:e,HIDDEN:e+"hidden",VISIBLE:e+"visible"}}.apply(t,r),!(void 0!==o&&(e.exports=o))},function(e,t,n){var r,o;r=[n(26),n(25),n(11),n(22),n(15),n(42),n(39),n(27),n(8),n(2),n(48)],o=function(e,t,n,r,o,i,a,s,u,c,d){function f(r){function f(){F.debug("init"),o.add({target:r,listeners:z})}function E(){o.remove({target:r,listeners:z})}function l(e){F.debug(e.name+": network state change from "+D(x)+" to "+D(e.data.connectionState)),x=e.data.connectionState}function p(e){}function T(e){if(M=e.data.onServerInfo,V){var t=M.capabilities,n=M.serverVersion,o=parseFloat(n);t.indexOf("onPlay")===-1&&t.indexOf("onPause")===-1&&(V=!1,r.emit(i.NO_KEEP_CONNECTION,{message:o<1.8?"The keepConnection feature is enabled by the players config, but is not supported by this server version ("+n+"). Use at least server version 1.8.0.0. The feature will be disabled.":"The keepConnection feature is enabled by the players config, but is not enabled by this server ("+n+"). The feature will be disabled."}),W||v())}r.emit(i.SERVER_INFO,e.data)}function m(e){w=e.data.config,y(w.source.h5live),L=w.id,Y=w.playback.metadata,V=w.playback.keepConnection,W=w.playback.autoplay,H=t.mustUseHLS||w.playback.allowSafariHlsFallback&&t.canUseHLS,V&&N()}function A(e){var t=e.data.source,o=e.data.options;if(q+=1,o.tag=o.tag||"",o.count=q,r.emit(i.UPDATE_SOURCE_INIT,{source:t,options:o,tag:o.tag,count:o.count}),j)throw r.emit(i.UPDATE_SOURCE_ABORT,{source:t,reason:"updatefrequency",tag:o.tag,count:o.count}),new n("The 'updateSource' function was called to close to the last call. The call is aborted.");j=!0,setTimeout(function(){j=!1},500),K=e.data,F.debug("update source: "+JSON.stringify(t)),G.length>1&&G.pop(),y(t.h5live),V&&!W?(F.debug("connect to new source with terminating the old one"),v(!0),G.shift(),N()):W?(F.debug("connect to new source without terminating the old one"),N(e.data)):(G.shift(),F.debug("replaced source"))}function _(e){G.length>1&&G.shift(),r.emit(i.UPDATE_SOURCE_SUCCESS,{tag:e.data.tag,count:e.data.count}),K=!1}function S(e){G.length>1&&G.pop(),r.emit(i.UPDATE_SOURCE_FAIL,{tag:e.data.tag,count:e.data.count,code:e.data.code,message:e.data.message}),K=!1}function h(e){G.length>1&&G.pop(),r.emit(i.UPDATE_SOURCE_ABORT,{tag:e.data.tag,count:e.data.count,reason:e.data.reason}),K=!1}function R(){if(F.debug("api play"),W=!0,V?(F.debug("send network play"),r.emit(i.NETWORK_PLAY)):B||N(K&&K.options.forcePlay?K:void 0),H){var e=I("hls");r.emit(i.VIDEO_SOURCE,{src:e,type:d.HLS}),r.emit(i.URL,{url:e})}}function O(){F.debug("api pause"),W=!1,V&&!K||v(),H&&r.emit(i.VIDEO_SOURCE,{src:"",type:d.HLS})}function g(e){switch(U=e.data.state){case u.PAUSED:K&&H&&[c.NORMAL,c.PLAYBACK_RESTART].indexOf(e.data.reason)===-1&&S({data:{tag:K.options.tag,count:K.options.count}});break;case u.PLAYING:K&&H&&_({data:{tag:K.options.tag,count:K.options.count}})}}function N(e){var t=e?G.length-1:0;if(Y||G[t].security||!H){W?b("paused"):C("paused"),Y&&H?C("metastreamonly"):b("metastreamonly"),!Y&&G[t].security&&H?C("checkandclose"):b("checkandclose");var n=I("websocket",t),o=e?i.NETWORK_UPDATE_SOURCE:i.CONNECT;F.debug("connect to: "+n,1),r.emit(o,{url:n,config:G[t],update:!!e&&e,reconnect:w.playback.reconnect,timeouts:w.playback.timeouts}),H||r.emit(i.URL,{url:n})}}function v(e){F.debug("disconnecting"),r.emit(i.DISCONNECT,{silent:!!e})}function y(e){F.debug("set connection config",3);var t,n=new P,o=e.server,a=e.rtmp,s=e.params,u=e.token,c=e.security;if("object"==typeof o){for(var d=["websocket","hls","progressive"],f=0;f<d.length;f++)o[d[f]]&&"string"==typeof o[d[f]]&&0!==o[d[f]].length&&(n.server[d[f]]=o[d[f]]);F.debug("set connection server: "+JSON.stringify(n.server),3)}if(n.server.websocket.length||n.server.hls.length||r.emit(i.NO_SERVER_ERROR),"object"==typeof a&&a.url&&a.url.length&&a.streamname&&a.streamname.length||s){for(t in a)if(a.hasOwnProperty(t)){var E=t.replace("name","");n.query.hasOwnProperty(E)&&(n.query[E]=a[t],F.debug("set connection config rtmp: "+E+":"+n.query[E]))}}else r.emit(i.MISSING_RTMP_ERROR);if(u&&n.query.hasOwnProperty("token")&&(n.query.token=u,F.debug("set connection config token: "+n.query.token)),"object"==typeof s)for(t in s)s.hasOwnProperty(t)&&(n.query[t]=s[t],F.debug("set connection param: "+t+":"+n.query[t]));if(c){n.security={},F.debug("set security config",3);for(var t in c)c.hasOwnProperty(t)&&c[t].length&&(n.security[t]=c[t],F.debug("set security config "+t+": "+n.security[t]))}G.push(n)}function I(e,t){var n,r="?",o=void 0!==typeof t&&t>-1&&void 0!==typeof G[t]?t:G.length-1,i=G[o].server,a=G[o].query,s=G[o].security;n=i[e];for(var u in a)a.hasOwnProperty(u)&&("cid"===u&&(a[u]=Math.round(1e6*Math.random()).toString()),"pid"!==u||a[u].length||(a[u]=L),a[u].length&&(r+=u+"="+encodeURIComponent(a[u])+"&"));for(var u in s)s.hasOwnProperty(u)&&s[u].length&&(r+=u+"="+encodeURIComponent(s[u])+"&");for(var c="",o=0,d=k.length;o<d;o+=1)c+=k[o],o===d-1?r+="&flags="+encodeURIComponent(c):c+=",";return r.lastIndexOf("&")===r.length-1&&(r=r.substr(0,r.length-1)),n+r}function C(e){k.indexOf(e)===-1&&k.push(e)}function b(e){k=k.filter(function(t){return t!==e})}function D(e){for(var t in s)if(s.hasOwnProperty(t)&&s[t]===e)return t}function P(){return{server:{websocket:"",hls:"",progressive:""},query:{url:"",stream:"",cid:"",pid:"",token:""},security:null}}var U,L,w,M,F=e.create("Connection"),G=[],k=[],x=s.UNITIALIZED,B=!1,Y=!1,V=!1,H=!1,W=!0,K=!1,j=!1,q=0,z=[{type:a.NETWORK_STATE_CHANGE,listener:l},{type:a.SERVER_INFO,listener:T},{type:a.STREAM_INFO,listener:p},{type:a.UPDATE_SOURCE_SUCCESS,listener:_},{type:a.UPDATE_SOURCE_FAIL,listener:S},{type:a.UPDATE_SOURCE_ABORT,listener:h},{type:a.CONFIG,listener:m},{type:a.UPDATE_SOURCE,listener:A},{type:a.API_PLAY,listener:R},{type:a.API_PAUSE,listener:O},{type:a.APPLICATION_STATE_CHANGE,listener:g}];return f(),{destroy:E}}return{create:f}}.apply(t,r),!(void 0!==o&&(e.exports=o))},function(e,t,n){var r,o;r=[],o=function(){return Object.freeze({MP4:"video/mp4",MP4_MS:'video/mp4; codecs="avc1.42E01E, mp4a.40.2"',HLS:"application/vnd.apple.mpegURL"})}.apply(t,r),!(void 0!==o&&(e.exports=o))},function(e,t,n){var r,o;r=[n(26),n(25),n(15),n(41),n(39),n(8)],o=function(e,t,n,r,o,i){function a(a){function s(){R.debug("init"),n.add({target:a,listeners:C}),t.isTridentBrowser&&n.add({target:a,listeners:b})}function u(){n.remove({target:a,listeners:C}),t.isTridentBrowser&&n.remove({target:a,listeners:b})}function c(e){O.buffer=e.data.tweaks.buffer}function d(e){for(N.push(e.data.onRandomAccessPoint.streamTime/1e3);N.length>10;)N.shift()}function f(e){t.isTridentBrowser&&"extreme"===e.data.type&&!I&&S===i.PLAYING&&(R.debug("visible and extreme frame drop detected (edge)"),R.debug("try seeking to last RAP to get stable playback"),A(N.length?N[N.length-1]:0))}function E(e){I=e.name!==o.VIEWPORT_VISIBLE,R.debug("viewport changed to "+(I?"hidden":"visible"))}function l(e){switch(n.remove({target:a,listeners:D}),S=e.data.state){case i.PLAYING:n.add({target:a,listeners:D})}}function p(e){h=e.data.stats,y=e.data.playbackRate,g=e.data.currentTime,e.data.buffered&&e.data.buffered.length&&(v=h.buffer.end>v+.1?h.buffer.end:v,O.buffer.max<h.buffer.delay.current&&h.buffer.start<g&&h.buffer.end-h.buffer.start>O.buffer.target?(R.debug("tweaks.buffer.max ("+O.buffer.max+") < stats.buffer.delay.current ("+h.buffer.delay.current+") && stats.buffer.start ("+h.buffer.start+") < currentTime ("+g+") && stats.buffer.end ("+h.buffer.end+") > tweaks.buffer.target ("+O.buffer.target+")"),m(O.buffer.target)):O.buffer.limit<h.buffer.delay.current?t.isTridentBrowser?m(O.buffer.target):T(1.1):O.buffer.target>h.buffer.delay.current&&T(1))}function T(e){y!==e&&(R.debug("set rate to "+e),a.emit(r.RATE,{rate:e}))}function m(e){var n=v-e;t.isTridentBrowser&&(n=_(g,n),n<0)||A(n)}function A(e){R.debug("seeking to "+e),a.emit(r.SEEK,{position:e})}function _(e,t){for(var n=0;n<N.length;++n)if(N[n]>e&&N[n]<=t)return N[n];return-1}var S,h,R=e.create("WSSLiveController"),O={},g=0,N=[],v=0,y=1,I=!1,C=[{type:o.APPLICATION_STATE_CHANGE,listener:l},{type:o.BUFFER_TWEAKS_CREATED,listener:c},{type:o.RANDOM_ACCESS_POINT,listener:d},{type:o.FRAME_DROP,listener:f}],b=[{type:o.VIEWPORT_VISIBLE,listener:E},{type:o.VIEWPORT_HIDDEN,listener:E}],D=[{type:o.PLAY_STATS,listener:p}];return s(),{destroy:u}}return{create:a}}.apply(t,r),!(void 0!==o&&(e.exports=o))},function(e,t,n){var r,o;r=[n(26),n(25),n(15),n(41),n(39),n(8)],o=function(e,t,n,r,o,i){function a(t){function a(){p.debug("init"),n.add({target:t,listeners:_})}function s(){n.remove({target:t,listeners:_})}function u(e){for(var t in e.data.tweaks.buffer)e.data.tweaks.buffer[t]!==m.buffer[t]&&(T=!1);T||(m.buffer=e.data.tweaks.buffer)}function c(e){switch(n.remove({target:t,listeners:S}),E=e.data.state){case i.PLAYING:n.add({target:t,listeners:S})}}function d(e){l=e.data.stats,A=e.data.playbackRate,e.data.buffered&&e.data.buffered.length&&(T?l.buffer.update.avg>0&&l.buffer.update.avg+m.buffer.limit-.7<l.buffer.delay.avg?f(1.1):l.buffer.update.avg>0&&l.buffer.update.avg+m.buffer.min<l.buffer.delay.avg<=l.buffer.update.avg+m.buffer.target-.7?f(1):l.buffer.update.avg>=0&&l.buffer.update.avg>=l.buffer.delay.avg&&f(.9):m.buffer.limit<l.buffer.delay.avg?f(1.1):m.buffer.start<l.buffer.delay.avg<=m.buffer.target?f(1):m.buffer.min>=l.buffer.delay.avg&&f(.9))}function f(e){A!==e&&(p.debug("set rate to: "+e),t.emit(r.RATE,{rate:e}))}var E,l,p=e.create("HLSLiveController"),T=!0,m={buffer:{max:8,min:.2,start:.5,target:1.2,limit:1.7}},A=1,_=[{type:o.APPLICATION_STATE_CHANGE,listener:c},{type:o.BUFFER_TWEAKS_CREATED,listener:u}],S=[{type:o.PLAY_STATS,listener:d}];return a(),{destroy:s}}return{create:a}}.apply(t,r),!(void 0!==o&&(e.exports=o))},function(e,t,n){var r,o;r=[n(26),n(25),n(15),n(39),n(44),n(8),n(52),n(48)],o=function(e,t,n,r,o,i,a,s){function u(u){function c(){O.debug("init"),n.add({target:u,listeners:g})}function d(){n.remove({target:u,listeners:g})}function f(e,t){h=t.data.onStreamInfo,O.debug(JSON.stringify(h));var n=h&&h.mimeType?h.mimeType:s.MP4_MS;if(window.MediaSource.isTypeSupported(n)){var r={},i=[a.PREROLL_DURATION,a.MIME_TYPE];for(var c in a)if(a.hasOwnProperty(c)){var d=a[c];a.hasOwnProperty(c)&&h.hasOwnProperty(d)&&i.indexOf(d)===-1&&(r[d]=h[d])}h=r,h.url=R,u.emit(e,{streamInfo:h})}else u.emit(o.MIME_TYPE_UNSUPPORTED)}function E(e){_=e.data.state}function l(e){S=t.mustUseHLS||e.data.config.playback.allowSafariHlsFallback&&t.canUseHLS}function p(e){R=e.data.url}function T(e){_!==i.READY&&f(o.CREATED,e)}function m(e){_!==i.BUFFERING&&_!==i.PLAYING||f(o.UPDATED,e)}function A(e){S&&_===i.LOADING&&(h={haveAudio:e.data.haveAudio,haveVideo:e.data.haveVideo,audioInfo:e.data.haveAudio?{bitsPerSample:null,channels:null,sampleRate:null}:null,videoInfo:e.data.haveVideo?{width:e.data.videoWidth,
height:e.data.videoHeight,frameRate:null}:null},h.url=R,u.emit(o.CREATED,{streamInfo:h}))}var _,S,h,R,O=e.create("StreamInfo"),g=[{type:r.APPLICATION_STATE_CHANGE,listener:E},{type:r.CONFIG,listener:l},{type:r.STREAM_INFO,listener:T},{type:r.STREAM_INFO_UPDATE,listener:m},{type:r.STREAM_URL,listener:p},{type:r.CAN_PLAY,listener:A}];return c(),{destroy:d}}return{create:u}}.apply(t,r),!(void 0!==o&&(e.exports=o))},function(e,t,n){var r,o;r=[],o=function(){return Object.freeze({HAVE_VIDEO:"haveVideo",HAVE_AUDIO:"haveAudio",VIDEO_INFO:"videoInfo",AUDIO_INFO:"audioInfo",PREROLL_DURATION:"prerollDuration",MIME_TYPE:"mimeType"})}.apply(t,r),!(void 0!==o&&(e.exports=o))},function(e,t,n){var r,o;r=[n(26),n(25),n(15),n(41),n(39),n(43),n(8)],o=function(e,t,n,r,o,i,a){function s(t){function r(){R.debug("init"),n.add({target:t,listeners:O})}function s(){clearTimeout(S),clearTimeout(h),n.remove({target:t,listeners:O})}function p(e){switch(_=e.data.state){case a.READY:case a.PLAYING:case a.PAUSED:clearTimeout(S),clearTimeout(h)}_===a.BUFFERING?m():clearTimeout(h),_===a.LOADING&&A(e.data.connectDelay)}function T(e){var t=e.data.config,n=1e3*t.playback.timeouts.loading,r=1e3*t.playback.timeouts.buffering;u=Math.max(Math.min(n,d),c),f=Math.max(Math.min(r,l),E)}function m(){clearTimeout(h),h=setTimeout(function(){t.emit(i.BUFFERING_TIMEOUT,{delay:f})},f)}function A(e){clearTimeout(S),S=setTimeout(function(){t.emit(i.LOADING_TIMEOUT,{delay:u+e})},u+e)}var _,S,h,R=e.create("Timeout"),O=[{type:o.APPLICATION_STATE_CHANGE,listener:p},{type:o.CONFIG,listener:T}];return r(),{destroy:s}}var u=2e4,c=1e4,d=6e4,f=2e4,E=1e4,l=6e4;return{create:s}}.apply(t,r),!(void 0!==o&&(e.exports=o))},function(e,t,n){var r,o;r=[n(26),n(25),n(15),n(21),n(8),n(39),n(45)],o=function(e,t,n,r,o,i,a){function s(s){function u(){N.debug("init"),n.add({target:s,listeners:v})}function c(){n.remove({target:s,listeners:v})}function d(){g=0,_=!0,S={handlerName:"",streamTime:0,message:[]},h=[],R=[],O=0}function f(e){switch(m=e.data.state){case o.LOADING:d(),n.add({target:s,listeners:y});break;case o.PAUSING:n.remove({target:s,listeners:y})}}function E(e){A=t.mustUseHLS||e.data.config.playback.allowSafariHlsFallback&&t.canUseHLS}function l(e){N.debug("onMetaData");var t=e.data[e.data.eventType];if(1===t.chunkIndex)"function"==typeof S.message.push&&0!==S.message.length&&s.emit(a.ERROR,{code:r.STREAM.METADATA_STILL_PROCESSING,message:"Received metadata with start index but currently process another. Discard old one."}),_=!0,S={handlerName:t.handlerName,streamTime:t.streamTime,message:[]};else{if(0===S.message.length||"function"!=typeof S.message.push)return void(_&&(s.emit(a.ERROR,{code:r.STREAM.METADATA_NO_START_INDEX,message:"Received metadata but no start index. Discard."}),_=!1,S.message=[]));if(!_)return}if(S.message.push(t.message),S.message.length!==t.chunkIndex)_&&(s.emit(a.ERROR,{code:r.STREAM.METADATA_WRONG_INDEX,message:"Received metadata with wrong index. Discard."}),_=!1,S.message=[]);else if(t.chunkCount-t.chunkIndex===0)try{var n=S.message.join(""),o=S.handlerName;N.debug("handlerName="+o+", metaData="+n),n=JSON.parse(n),S.message=n;var i={handlerName:S.handlerName,streamTime:S.streamTime,message:S.message};h.push(i)}catch(e){s.emit(a.ERROR,{code:r.STREAM.METADATA_INVALID_JSON,message:"Received metadata with invalid json string."})}}function p(e){for(g=e.data.currentTime;h.length;){var t=h.shift(),n=A&&e.data.stats.buffer.delay.avg?e.data.stats.buffer.delay.avg:0;t.streamTime+O+n<=g?(t.streamTime+=O+n,s.emit(a.RECEIVED,t)):R.push(t)}for(;R.length;)h.push(R.shift())}function T(){O=m===o.PLAYING&&A?g:0}var m,A,_,S,h,R,O,g,N=e.create("MetaData"),v=[{type:i.APPLICATION_STATE_CHANGE,listener:f},{type:i.CONFIG,listener:E}],y=[{type:i.META_DATA,listener:l},{type:i.PLAY_STATS,listener:p},{type:i.NETWORK_CONNECTED,listener:T}];return u(),{destroy:c}}return{create:s}}.apply(t,r),!(void 0!==o&&(e.exports=o))},function(e,t,n){var r,o;r=[n(15),n(26),n(39),n(46)],o=function(e,t,n,r){function o(o){function i(){E.debug("initialize"),e.add({target:o,listeners:p}),"undefined"!=typeof document.hidden?(c="hidden",d="visibilitychange"):"undefined"!=typeof document.msHidden?(c="msHidden",d="msvisibilitychange"):"undefined"!=typeof document.webkitHidden&&(c="webkitHidden",d="webkitvisibilitychange"),document.addEventListener(d,s)}function a(){e.remove({target:o,listeners:p}),document.removeEventListener(d,s)}function s(){l=document[c],E.debug(l?"hidden":"visible"),o.emit(l?r.HIDDEN:r.VISIBLE)}function u(e){f||(E.debug("initial player state"),s()),f=e.data.state}var c,d,f,E=t.create("VisibilityProxy"),l=!1,p=[{type:n.APPLICATION_STATE_CHANGE,listener:u}];return i(),{destroy:a}}return{create:o}}.apply(t,r),!(void 0!==o&&(e.exports=o))},function(e,t,n){var r,o;r=[n(4),n(15),n(40),n(29),n(31),n(30),n(32),n(14),n(57),n(58),n(59),n(62)],o=function(e,t,n,r,o,i,a,s,u,c,d,f){"use strict";function E(t){function n(){d=s.create(t,l,m),E=s.create(l,t,T),p.push(f.create(l))}function i(){for(d.destroy(),d=null,E.destroy(),E=null;p.length;)p.pop().destroy()}var d,E,l=new e,p=[],T=[{from:c.CONNECTING,to:a.CONNECTING},{from:c.CONNECTED,to:a.CONNECTED},{from:c.RESUMING,to:a.RESUMING},{from:c.DESTROYED,to:a.DESTROYED},{from:c.RECONNECTING,to:a.RECONNECTING},{from:c.RECONNECTION_IMMINENT,to:a.RECONNECTION_IMMINENT},{from:c.RECONNECTION_CONFIG_INVALID,to:a.RECONNECTION_CONFIG_INVALID},{from:c.DISCONNECTED,to:a.DISCONNECTED},{from:c.INITIALIZATION_ERROR,to:a.INITIALIZATION_ERROR},{from:c.CONNECTION_ERROR,to:a.CONNECTION_ERROR},{from:c.ERROR,to:a.ERROR},{from:c.WARNING,to:a.WARNING},{from:c.STATE_CHANGE,to:a.STATE_CHANGE},{from:c.UPDATE_SOURCE_SUCCESS,to:a.UPDATE_SOURCE_SUCCESS},{from:c.UPDATE_SOURCE_FAIL,to:a.UPDATE_SOURCE_FAIL},{from:c.UPDATE_SOURCE_ABORT,to:a.UPDATE_SOURCE_ABORT},{from:c.META_DATA,to:a.META_DATA},{from:c.RANDOM_ACCESS_POINT,to:a.RANDOM_ACCESS_POINT},{from:c.SERVER_INFO,to:a.SERVER_INFO},{from:c.STREAM_INFO,to:a.STREAM_INFO},{from:c.STREAM_INFO_UPDATE,to:a.STREAM_INFO_UPDATE},{from:c.RAW_PACKET,to:a.RAW_PACKET},{from:c.STREAM_FRAGMENT,to:a.STREAM_FRAGMENT},{from:c.STREAM_STATUS,to:a.STREAM_STATUS}],m=[{from:r.CONNECT,to:u.CONNECT},{from:r.DISCONNECT,to:u.DISCONNECT},{from:r.NETWORK_PLAY,to:u.PLAY},{from:r.PAUSE,to:u.PAUSE},{from:r.CONFIG,to:u.CONFIG},{from:r.NETWORK_UPDATE_SOURCE,to:u.UPDATE_SOURCE},{from:o.STATE_CHANGE,to:u.STATE_CHANGE}];return n(),{destroy:i}}return{create:E}}.apply(t,r),!(void 0!==o&&(e.exports=o))},function(e,t,n){var r,o;r=[],o=function(){var e="networkmanager.";return{BASE:e,CONNECT:e+"connect",DISCONNECT:e+"disconnect",PLAY:e+"play",PAUSE:e+"pause",CONFIG:e+"config",UPDATE_SOURCE:e+"updateSource",STATE_CHANGE:e+"stateChange"}}.apply(t,r),!(void 0!==o&&(e.exports=o))},function(e,t,n){var r,o;r=[],o=function(){var e="webSocketHandler.";return{BASE:e,CONNECTING:e+"connecting",CONNECTED:e+"connected",DISCONNECTED:e+"disconnected",RESUMING:e+"resuming",MESSAGE:e+"message",RECONNECTION_IMMINENT:e+"reconnectionImminent",RECONNECTING:e+"reconnecting",RECONNECTION_CONFIG_INVALID:e+"reconnectionConfigInvalid",CONNECTION_ERROR:e+"connectionError",INITIALIZATION_ERROR:e+"initializationError",DESTROYED:e+"destroyed",ERROR:e+"error",WARNING:e+"warning",STATE_CHANGE:e+"stateChange",META_DATA:e+"metaData",SERVER_INFO:e+"serverInfo",STREAM_INFO:e+"streamInfo",STREAM_INFO_UPDATE:e+"streamInfoUpdate",STREAM_FRAGMENT:e+"streamFragment",RANDOM_ACCESS_POINT:e+"randomAccessPoint",RAW_PACKET:e+"raw",STREAM_STATUS:e+"streamStatus",UPDATE_SOURCE_SUCCESS:e+"updateSourceSuccess",UPDATE_SOURCE_FAIL:e+"updateSourceFail",UPDATE_SOURCE_ABORT:e+"updateSourceAbort"}}.apply(t,r),!(void 0!==o&&(e.exports=o))},function(e,t,n){var r,o;r=[n(15),n(60),n(61)],o=function(e,t,n){"use strict";function r(r){function o(){e.add({target:r,listeners:d})}function i(){e.remove({target:r,listeners:d})}function a(e){if(e){var n=e.data;if("string"==typeof n){var o=JSON.parse(n);if(o&&o.eventType){var i=o.eventType.substr(2,o.eventType.length-2),a=t.BASE+i[0].toLowerCase()+i.slice(1);a.indexOf(t.STREAM_INFO)!==-1&&s(),r.emit(a,o)}}else if(n instanceof ArrayBuffer&&n.byteLength>0){var d=new Uint8Array(n);if(r.emit(t.RAW_PACKET),n.byteLength>=8&&109===d[4]&&111===d[5]&&111===d[6]&&(102===d[7]||118===d[7])){for(var f=new Uint8Array(c),E=0,l=0;l<u.length;l++)f.set(u[l],E),E+=u[l].length;s(),r.emit(t.STREAM_FRAGMENT,f)}u.push(d),c+=n.byteLength}}}function s(){for(;u.length;)u.pop();c=0}var u=[],c=0,d=[{type:n.MESSAGE,listener:a}];return o(),{destroy:i}}return{create:r}}.apply(t,r),!(void 0!==o&&(e.exports=o))},function(e,t,n){var r,o;r=[],o=function(){var e="message.";return{BASE:e,META_DATA:e+"metaData",SERVER_INFO:e+"serverInfo",STREAM_INFO:e+"streamInfo",STREAM_INFO_UPDATE:e+"streamInfoUpdate",STREAM_FRAGMENT:e+"streamFragment",RANDOM_ACCESS_POINT:e+"randomAccessPoint",RAW_PACKET:e+"raw",STREAM_STATUS:e+"streamStatus",UPDATE_SOURCE_SUCCESS:e+"updateSourceSuccess",UPDATE_SOURCE_ERROR:e+"updateSourceError",UPDATE_SOURCE_ABORT:e+"updateSourceAbort"}}.apply(t,r),!(void 0!==o&&(e.exports=o))},function(e,t,n){var r,o;r=[],o=function(){var e="webSocketProxy.";return{BASE:e,CONNECTING:e+"connecting",CONNECTED:e+"connected",DISCONNECTED:e+"disconnected",RESUMING:e+"resuming",MESSAGE:e+"message",RECONNECTION_IMMINENT:e+"reconnectionImminent",RECONNECTING:e+"reconnecting",RECONNECTION_CONFIG_INVALID:e+"reconnectionConfigInvalid",CONNECTION_ERROR:e+"connectionError",INITIALIZATION_ERROR:e+"initializationError",DESTROYED:e+"destroyed",ERROR:e+"error",STATE_CHANGE:e+"stateChange",META_DATA:e+"metaData",SERVER_INFO:e+"serverInfo",STREAM_INFO:e+"streamInfo",STREAM_INFO_UPDATE:e+"streamInfoUpdate",STREAM_FRAGMENT:e+"streamFragment",RANDOM_ACCESS_POINT:e+"randomAccessPoint",RAW_PACKET:e+"raw",STREAM_STATUS:e+"streamStatus",UPDATE_SOURCE_SUCCESS:e+"updateSourceSuccess",UPDATE_SOURCE_ERROR:e+"updateSourceError",UPDATE_SOURCE_ABORT:e+"updateSourceAbort"}}.apply(t,r),!(void 0!==o&&(e.exports=o))},function(e,t,n){var r,o;r=[n(26),n(25),n(22),n(15),n(27),n(8),n(2),n(57),n(58),n(61),n(63),n(66),n(67),n(68)],o=function(e,t,n,r,o,i,a,s,u,c,d,f,E,l){function p(e){function t(){r.add({target:e,listeners:z}),r.add({target:e,listeners:X})}function n(){T.debug("destroy");for(var t in J)J.hasOwnProperty(t)&&(J[t].destroy(),delete J[t]);r.remove({target:e,listeners:z}),r.remove({target:e,listeners:X})}function o(t){T.debug("on connect"),1===J.length&&Y().isWaitForReconnect()?Y().connect(t):1===J.length&&(J.push(d.create(e)),V().connect(t)),J.length||(J[0]=d.create(e),J[0].setActive(!0),Y().connect(t))}function a(e){if(T.debug("on disconnect"),1!==J.length||!Y().isWaitForReconnect())for(T.debug("not waiting for reconnect");J.length;)J.pop().destroy()}function f(){T.debug("on play"),1===J.length&&J[0].play()}function E(){T.debug("on pause"),1===J.length&&J[0].pause()}function l(t){if(T.debug("on update source"),0===J.length)t.data.update.options.method="client",o(t);else{for(;J.length>1;){var n=V().getConnectData().update.options;e.emit(c.UPDATE_SOURCE_ABORT,{reason:"superseded",tag:n.tag,count:n.count}),K()}var r=J[0].getConnectData(),i=J[0].getServerInfo(),a=r.config.server.websocket!==t.data.config.server.websocket,s=!i,u=i.capabilities.indexOf("onUpdateSource")===-1,d="client"===t.data.update.options.method;a||s||u||d?(t.data.update.options.method="client",j(r.config.query,t.data.config.query)?e.emit(c.UPDATE_SOURCE_ABORT,{reason:"equalsource",tag:t.data.update.options.tag,count:t.data.update.options.count}):o(t)):(t.data.update.options.method="server",J[0].updateSource(t))}}function p(e){e.data.state===i.PAUSING&&q!==i.RECONNECTION_IMMINENT&&J.length&&Y().reset(),q=e.data.state}function m(e){T.debug("fired "+e.name),e.active&&B(e)}function A(e){T.debug("fired "+e.name),e.active&&B(e)}function _(t){T.debug("fired "+t.name),t.update&&e.emit(u.UPDATE_SOURCE_FAIL,{tag:t.update.update.options.tag,count:t.update.update.options.count,code:t.data.code,message:t.data.message}),(H()||t.active)&&B(t),K()}function S(e){T.debug("fired "+e.name),e.active&&B(e)}function h(e){T.debug("fired "+e.name),e.active&&B(e)}function R(e){T.debug("fired "+e.name),e.active&&B(e)}function O(e){T.debug("fired "+e.name),e.active&&B(e)}function g(t){T.debug("fired "+t.name),t.update&&e.emit(u.UPDATE_SOURCE_FAIL,{tag:t.update.update.options.tag,count:t.update.update.options.count,code:t.data.code,message:t.data.message}),t.active&&B(t)}function N(e){T.debug("fired "+e.name),(H()||e.active)&&B(e),K()}function v(t){T.debug("fired "+t.name),t.update&&e.emit(u.UPDATE_SOURCE_FAIL,{tag:t.update.update.options.tag,count:t.update.update.options.count,code:t.data.code,message:t.data.message}),(H()||t.active)&&B(t),K()}function y(e){T.debug("fired "+e.name),e.active&&B(e)}function I(t){T.debug("fired "+t.name),t.update&&e.emit(u.UPDATE_SOURCE_FAIL,{tag:t.update.update.options.tag,count:t.update.update.options.count,code:t.data.code,message:t.data.message}),(H()||t.active)&&B(t),K()}function C(e){T.debug("fired "+e.name),e.active&&B(e)}function b(e){T.debug("fired "+e.name),e.active&&B(e)}function D(e){T.debug("fired "+e.name),e.active&&B(e)}function P(e){T.debug("fired "+e.name),e.active&&B(e)}function U(e){T.debug("fired "+e.name),e.active&&B(e)}function L(e){T.debug("fired "+e.name),e.active&&B(e)}function w(e){T.debug("fired "+e.name),e.active&&B(e)}function M(e){T.debug("fired "+e.name),e.active&&B(e)}function F(e){T.debug("fired "+e.name),e.active&&!e.update&&B(e)}function G(t){T.debug("fired "+t.name),t.active||(W(),t.active=!0,V().setActive(!0)),T.debug("trigger update source success"),e.emit(u.UPDATE_SOURCE_SUCCESS,{tag:t.data.tag,count:t.data.count})}function k(t){T.debug("fired "+t.name),T.debug("trigger update source fail"),e.emit(u.UPDATE_SOURCE_FAIL,{tag:t.data.tag,count:t.data.count,code:t.data.code,message:t.data.message}),H()&&(T.debug("trigger disconnected"),e.emit(u.DISCONNECTED,{code:t.data.code,message:t.data.message})),K()}function x(t){T.debug("fired "+t.name),T.debug("trigger update source abort"),e.emit(u.UPDATE_SOURCE_ABORT,{tag:t.data.tag,count:t.data.count,reason:t.data.reason})}function B(t){T.debug("pass "+t.name),t.name=t.name.replace(c.BASE,u.BASE),e.emit(t.name,t)}function Y(){T.debug("get active connection");for(var e=!1,t=0;t<J.length;t+=1)if(J[t].isActive()){T.debug("found active connection"),e=J[t];break}return e}function V(){var e=!1;return J.length&&(e=J[J.length-1]),e}function H(){var e=!!V()&&V().shouldPauseOnError();return T.debug("should pause on error: "+e),e}function W(){T.debug("drop active connection?"),J.length>1&&(T.debug("drop active connection!"),J.shift().destroy())}function K(){T.debug("drop inactive connection?"),J.length>1&&(T.debug("drop inactive connection!"),J.pop().destroy())}function j(e,t){var n=!1;return e.url&&t.url&&e.stream&&t.stream&&(n=e.url===t.url&&e.stream===t.stream),n}var q,z=[{type:s.CONNECT,listener:o},{type:s.DISCONNECT,listener:a},{type:s.PLAY,listener:f},{type:s.PAUSE,listener:E},{type:s.UPDATE_SOURCE,listener:l},{type:s.STATE_CHANGE,listener:p}],X=[{type:c.CONNECTING,listener:m},{type:c.CONNECTED,listener:A},{type:c.DISCONNECTED,listener:_},{type:c.RESUMING,listener:S},{type:c.MESSAGE,listener:h},{type:c.RECONNECTION_IMMINENT,listener:R},{type:c.RECONNECTING,listener:O},{type:c.RECONNECTION_CONFIG_INVALID,listener:g},{type:c.CONNECTION_ERROR,listener:N},{type:c.INITIALIZATION_ERROR,listener:v},{type:c.DESTROYED,listener:y},{type:c.ERROR,listener:I},{type:c.STATE_CHANGE,listener:C},{type:c.META_DATA,listener:b},{type:c.SERVER_INFO,listener:D},{type:c.STREAM_INFO,listener:P},{type:c.STREAM_INFO_UPDATE,listener:U},{type:c.STREAM_FRAGMENT,listener:L},{type:c.RANDOM_ACCESS_POINT,listener:w},{type:c.RAW_PACKET,listener:M},{type:c.STREAM_STATUS,listener:F},{type:c.UPDATE_SOURCE_SUCCESS,listener:G},{type:c.UPDATE_SOURCE_ERROR,listener:k},{type:c.UPDATE_SOURCE_ABORT,listener:x}],J=[];return t(),{destroy:n}}var T=e.create("WebSocketHandler");return{create:p}}.apply(t,r),!(void 0!==o&&(e.exports=o))},function(e,t,n){var r,o;r=[n(4),n(26),n(25),n(22),n(15),n(27),n(21),n(37),n(64),n(58),n(61),n(60),n(65),n(59),n(66),n(67),n(68),n(69)],o=function(e,t,n,r,o,i,a,s,u,c,d,f,E,l,p,T,m,A){function _(t){function c(){S.debug("init"),be.push(l.create(he)),o.add({target:he,listeners:Oe})}function _(){for(S.debug("destroy");be.length;)be.pop().destroy();se(),o.remove({target:he,listeners:Oe})}function g(e){if(S.debug("on connect"),Ie=!1,clearTimeout(le),me=e.data,me.count=Ce.retryCount,me.reconnect){var n=p.validate(me.reconnect);if(n.success)for(var r in me.reconnect)me.reconnect.hasOwnProperty(r)&&(Ce[r]=me.reconnect[r]);else t.emit(d.RECONNECTION_CONFIG_INVALID,fe({reason:n.reason}))}if(me.timeouts){var o=1e3*me.timeouts.connecting;h=Math.max(Math.min(o,O),R)}try{ie(me.url),t.emit(e.name?d.CONNECTING:d.RECONNECTING,fe(me)),Ae=e.data.update?e.data:void 0,F()&&(clearTimeout(Te),Te=setTimeout(re,1e3*e.data.update.options.timeout))}catch(e){var i="Connection initialization error.",s=e?ce(e):void 0;s&&s.message&&(i=s.message),s&&s.code&&(i+=" (code:"+s.code+")"),s&&s.name&&(i=s.name+": "+i),t.emit(d.INITIALIZATION_ERROR,fe({code:a.NETWORK.COULD_NOT_ESTABLISH_CONNECTION,message:i}))}}function N(){S.debug("on play");try{me=m.create(me,!1),null===ge?ie(me.url):(S.debug("sending play to server"),ue("onPlay"),t.emit(d.RESUMING,fe()))}catch(e){t.emit(d.ERROR,fe(ce(e)))}}function v(){S.debug("on pause");try{null!==ge&&(S.debug("sending pause to server"),me=m.create(me,!0),ue("onPause"))}catch(e){t.emit(d.ERROR,fe(ce(e)))}}function y(e){ae(e.data.silent)}function I(e){if(S.debug("on update source"),_e&&_e.capabilities.indexOf("onUpdateSource")!==-1&&"server"===e.data.update.options.method&&null!==ge){clearTimeout(Te),Te=setTimeout(re,1e3*e.data.update.options.timeout),Pe[e.data.update.options.count]=e.data,Ae=e.data,Ae.count=Ce.retryCount;var t=Ae.update,n={options:{fastStart:t.options.fastStart,incTiming:t.options.incTiming},tag:t.options.tag,count:t.options.count};if(t.source.h5live.rtmp&&t.source.h5live.rtmp.url&&t.source.h5live.rtmp.streamname&&(n.rtmp={url:t.source.h5live.rtmp.url,stream:t.source.h5live.rtmp.streamname}),t.source.h5live.params&&(n.params=pdate.source.h5live.params),t.source.h5live.security&&"object"==typeof t.source.h5live.security){n.security={};for(var r in t.source.h5live.security)t.source.h5live.security.hasOwnProperty(r)&&(n.security[r]=t.source.h5live.security[r])}ue("onUpdateSource",n)}}function C(){Ie=!1,Ce.retryCount=0}function b(){var e=Ne;return Ne=null!==ge?ge.readyState+2:i.UNINITIALIZED,Ne!==e&&t.emit(d.STATE_CHANGE,fe({connectionState:Ne})),Ne}function D(){return _e}function P(){return me}function U(){return ge}function L(){return Ie}function w(e){ye=!!e}function M(){return ye}function F(){return!!Ae&&Ae}function G(){return F()&&"client"===Ae.update.options.method}function k(){return P().config.query.cid}function x(e){return k()===e}function B(){return P().update&&P().update.options.pauseOnError||Ae&&Ae.update.options.pauseOnError}function Y(){S.debug("connection open"),setTimeout(function(){Ie||null===ge||(clearTimeout(ve),t.emit(d.CONNECTED,fe({count:Ce.retryCount})),Ce.retryCount=0)},200)}function V(e){S.debug("connection close"),clearTimeout(ve);var t=e;if(n.isTridentBrowser&&1005===e.code&&(t=r.copy(e),t.code=parseInt(e.reason.split(" ")[1])),4200===t.code)ae(!0);else{var o=t.code,i="Unknown reason.";u.hasOwnProperty(+o)&&(i=u[+o]),o>1e3&&o<4e3&&(o+=3100),oe(t,d.DISCONNECTED,fe({code:o,message:i}))}}function H(e){he.emit(d.MESSAGE,fe(e.data))}function W(e){S.debug("connection error"),clearTimeout(pe),pe=setTimeout(function(){if(!Ie&&null!==ge){clearTimeout(ve);var t="Connection error.",n=e?e:void 0;n&&n.message&&(t=n.message),n&&n.code&&(t+=" (code:"+n.code+")"),n&&n.name&&(t=n.name+": "+t),oe(e,d.CONNECTION_ERROR,fe({code:a.NETWORK.CONNECTION_ERROR,message:t}))}},200)}function K(){S.debug("connection timeout"),Ie||null===ge||oe(null,d.INITIALIZATION_ERROR,fe({code:a.NETWORK.COULD_NOT_ESTABLISH_CONNECTION,message:"Could not open connection. Timeout reached."}))}function j(e){Ee(e)}function q(e){_e=e.data.onServerInfo,Ee(e)}function z(e){Ee(e),Se=e.data.onStreamInfo}function X(e){Se=e.data.onStreamInfo,Ee(e)}function J(e){Ee(e)}function Q(e){Ee(e)}function Z(e){Ee(e)}function $(e){G()&&"stopped"===e.data.onStreamStatus.status&&t.emit(d.UPDATE_SOURCE_ERROR,fe({tag:Ae.update.options.tag,count:Ae.update.options.count,code:a.NETWORK.UPDATE_SOURCE_STREAM_STOPPED,message:s.NETWORK.UPDATE_SOURCE_STREAM_STOPPED})),Ee(e)}function ee(e){if(F()&&De.requestId>=e.data.onUpdateSourceSuccess.requestId){var n=e.data[e.data.eventType].tag,o=e.data[e.data.eventType].count;0===o&&(n=Ae.update.options.tag,o=Ae.update.options.count),t.emit(d.UPDATE_SOURCE_SUCCESS,fe({tag:n,count:o})),Pe[o]?(me=r.copy(Pe[o]),Ae===Pe[o]&&(Ae=void 0),delete Pe[o]):(me=Ae,Ae=void 0)}}function te(e){if(De.requestId>=e.data.onUpdateSourceError.requestId){var n=e.data.onUpdateSourceError.code,r="Unknown reason.";u.hasOwnProperty(+n)&&(r=u[+n]),n>1e3&&n<4e3&&(n+=3100);var o=e.data[e.data.eventType].tag,i=e.data[e.data.eventType].count;t.emit(d.UPDATE_SOURCE_ERROR,fe({tag:o,count:i,code:n,message:r})),Ae===Pe[i]&&(Ae=void 0),delete Pe[i]}}function ne(e){if(De.requestId>=e.data.onUpdateSourceAbort.requestId){var n=e.data[e.data.eventType].tag,r=e.data[e.data.eventType].count,o=e.data[e.data.eventType].reason;t.emit(d.UPDATE_SOURCE_ABORT,fe({tag:n,count:r,reason:o})),Ae===Pe[r]&&(Ae=void 0),delete Pe[r]}}function re(){if(F())for(t.emit(d.UPDATE_SOURCE_ERROR,fe({tag:Ae.update.options.tag,count:Ae.update.options.count,code:a.NETWORK.UPDATE_SOURCE_TIMEOUT,message:s.NETWORK.UPDATE_SOURCE_TIMEOUT})),Ae=void 0;Object.keys(Pe).length;)delete Pe[Object.keys(Pe)[0]]}function oe(e,n,r){if(!Ie)if(clearTimeout(le),le=0,M()&&(e&&e.data&&Re.indexOf(e.data.code)!==-1||r&&r.data&&Re.indexOf(r.data.code)!==-1)&&Ce.retryCount<Ce.maxRetries){if(Ie=!0,!Ce.retryCount){for(;Ce.delays.length;)Ce.delays.pop();Ce.delays=T.calculate(Ce.minDelay,Ce.maxDelay,Ce.delaySteps,Ce.maxRetries,Ce.randomFactor)}var o=Ce.delays[Ce.retryCount];Ce.retryCount++;var i=me;i.count=Ce.retryCount;var a=e&&e.data&&e.data.code?e.data.code:e&&e.code?e.code:0;a&&(a=r&&r.data&&r.data.code?r.data.code:r&&r.code?r.code:0),t.emit(d.RECONNECTION_IMMINENT,fe({delay:o,count:Ce.retryCount,code:a}))}else t.emit(n,r&&r.data?r:fe(r))}function ie(e){S.debug("create connection"),se(),ge=new A(e),ge.binaryType="arraybuffer",ge.addEventListener(E.OPEN,Y),ge.addEventListener(E.CLOSE,V),ge.addEventListener(E.MESSAGE,H),ge.addEventListener(E.ERROR,W),ve=setTimeout(K,h)}function ae(e){S.debug("destroy connection"+(e?" silent":"")),Ae=void 0,se(),t.emit(d.DESTROYED,fe({silent:!!e}))}function se(){clearTimeout(ve),clearTimeout(le),clearTimeout(pe),clearTimeout(Te),null!==ge&&(ge.onopen=null,ge.onclose=null,ge.onmessage=null,ge.onerror=null,ge.close(),ge=null)}function ue(e,t){if(S.debug("send "+e),t)try{t=JSON.stringify(t)}catch(e){t="{}"}else t="{}";var n=De.requestId+1;De={},De.eventType=e,De[e]=JSON.parse(t),De.requestId=n;var r=JSON.stringify(De);try{de()&&ge.send(r)}catch(e){}}function ce(e){return{code:e.code,name:e.name,message:e.message}}function de(){return b()===i.OPEN}function fe(e){return{data:e||void 0,connectionState:b(),connectionId:me.config.query.cid,active:M(),update:F()}}function Ee(e){var n=e.name.replace(f.BASE,d.BASE);t.emit(n,fe(e.data))}var le,pe,Te,me,Ae,_e,Se,he=new e,Re=[4102,4103,4105,4106,4107,4108,4109,4111,4115,4500,4503],Oe=[{type:f.META_DATA,listener:j},{type:f.SERVER_INFO,listener:q},{type:f.STREAM_INFO,listener:z},{type:f.STREAM_INFO_UPDATE,listener:X},{type:f.STREAM_FRAGMENT,listener:J},{type:f.RANDOM_ACCESS_POINT,listener:Q},{type:f.RAW_PACKET,listener:Z},{type:f.STREAM_STATUS,listener:$},{type:f.UPDATE_SOURCE_SUCCESS,listener:ee},{type:f.UPDATE_SOURCE_ERROR,listener:te},{type:f.UPDATE_SOURCE_ABORT,listener:ne}],ge=null,Ne=i.UNINITIALIZED,ve=0,ye=!1,Ie=!1,Ce={minDelay:2,maxDelay:10,delaySteps:10,maxRetries:10,delays:[],retryCount:0,randomFactor:1.5},be=[],De={requestId:0},Pe={};return c(),{connect:g,disconnect:y,play:N,pause:v,updateSource:I,reset:C,getState:b,getConnectData:P,getServerInfo:D,getWebSocket:U,setActive:w,isActive:M,isUpdate:F,isWaitForReconnect:L,getConnectionId:k,isConnectionId:x,shouldPauseOnError:B,destroy:_}}var S=t.create("WebSocketProxy"),h=5e3,R=5e3,O=3e4;return{create:_}}.apply(t,r),!(void 0!==o&&(e.exports=o))},function(e,t,n){var r,o;r=[],o=function(){return Object.freeze({1000:"Normal closure, meaning that the purpose for which the connection was established has been fulfilled.",1001:'An endpoint is "going away", such as a server going down or a browser having navigated away from a page.',1002:"An endpoint is terminating the connection due to a protocol error",1003:"An endpoint is terminating the connection because it has received a type of data it cannot accept (e.g., an endpoint that understands only text data MAY send this if it receives a binary message).",1004:"Reserved. The specific meaning might be defined in the future.",1005:"No status code was actually present.",1006:"Maybe no network, wrong url or server down.",1007:"An endpoint is terminating the connection because it has received data within a message that was not consistent with the type of the message (e.g., non-UTF-8 [http://tools.ietf.org/html/rfc3629] data within a text message).",1008:'An endpoint is terminating the connection because it has received a message that "violates its policy". This reason is given either if there is no other sutible reason, or if there is a need to hide specific details about the policy.',1009:"An endpoint is terminating the connection because it has received a message that is too big for it to process.",1011:"A server is terminating the connection because it encountered an unexpected condition that prevented it from fulfilling the request.",1015:"The connection was closed due to a failure to perform a TLS handshake (e.g., the server certificate can't be verified).",4005:"The requested source stream in the 'updateSource' call has been stopped.",4400:"Bad request. Maybe stream parameters are missing or malformed.",4403:"Access denied. The authentication token is missing or invalid.",4500:"The connection has been rejected due an internal server error.",4503:"The requested service is currently unavailable.",4900:"The security service has been rejected due an internal server error.",4901:"The security service denied access. The authentication token is invalid.",4903:"The security service denied access. The url is expired or a token parameter is missing (expires, token, or options).",4904:"The security service can not be found."})}.apply(t,r),!(void 0!==o&&(e.exports=o))},function(e,t,n){var r,o;r=[],o=function(){var e="";return{BASE:e,OPEN:e+"open",CLOSE:e+"close",MESSAGE:e+"message",ERROR:e+"error"}}.apply(t,r),!(void 0!==o&&(e.exports=o))},function(e,t,n){var r,o;r=[],o=function(){function e(e){for(var t=["minDelay","maxDelay","delaySteps","maxRetries"],n=0;n<t.length;++n){if(!e.hasOwnProperty(t[n]))return{success:!1,reason:"The reconnect config is invalid, it must contain 'minDelay', 'maxDelay', 'delaySteps', and 'maxRetries'. Reset to default."};if("number"!=typeof e[t[n]])return{success:!1,reason:"The reconnect config is invalid, the value '"+t[n]+"' have to be a number. Reset to default."}}return e[t[0]]>e[t[1]]?{success:!1,reason:"The reconnect config is invalid, the value '"+t[0]+"' have to be lower then '"+t[1]+"'. Reset to default."}:e[t[0]]<1?{success:!1,reason:"The reconnect config is invalid, the value '"+t[0]+"' have to be greater or equal then 1 sec. Reset to default."}:{success:!0}}return{validate:e}}.apply(t,r),!(void 0!==o&&(e.exports=o))},function(e,t,n){var r,o;r=[],o=function(){function e(e,t,n,r,o){var i=[],a=Math.sqrt(e),s=Math.sqrt(t);n>r&&(n=r);for(var u=(s-a)/(n-1),c=0;c<r;c+=1){var d=o*(Math.random()-.5),f=a+u*Math.min(n-1,c)+(!c&&a-Math.abs(d)<=.5?Math.abs(d)+o*Math.random():d),E=Math.round(f*f*1e3);i.push(E)}return i}return{calculate:e}}.apply(t,r),!(void 0!==o&&(e.exports=o))},function(e,t,n){var r,o;r=[],o=function(){function e(e,t){var n=e.url.split("&flags=");if(n.length>1&&(n[1]=decodeURIComponent(n[1])),t)n.length>1&&n[1].indexOf("paused")===-1?e.url=n[0]+"&flags="+encodeURIComponent("paused,"+n[1]):1===n.length&&(e.url+="&flags=paused");else if(n.length>1&&n[1].indexOf("paused")!==-1){var r=n[1].split(",");if(1===r.length)e.url=e.url.replace("&flags=paused","");else{e.url=n[0]+"&flags=";for(var o=0;o<r.length;o+=1)"paused"!==r[o]&&(e.url+=encodeURIComponent(r[o]),e.url+=encodeURIComponent(r.length>2&&o<r.length-1?",":""))}}return e}return{create:e}}.apply(t,r),!(void 0!==o&&(e.exports=o))},function(e,t,n){var r,o;r=[n(65)],o=function(e){var t=WebSocket.addEventListener;return WebSocket.prototype.addEventListener=function(n,r,o){void 0!==typeof this["on"+n]&&e[n.toUpperCase()]===n?this["on"+n]=r:t(n,r,o)},WebSocket}.apply(t,r),!(void 0!==o&&(e.exports=o))},function(e,t,n){var r,o;r=[n(26),n(25),n(4),n(10),n(15),n(14),n(48),n(29),n(31),n(30),n(32),n(72),n(73),n(74),n(75),n(76),n(71),n(77),n(78),n(79),n(80),n(81),n(84),n(88),n(92),n(93),n(94),n(95),n(96),n(97),n(98)],o=function(e,t,n,r,o,i,a,s,u,c,d,f,E,l,p,T,m,A,_,S,h,R,O,g,N,v,y,I,C,b,D){"use strict";function P(r){function P(){o.add({target:G,listeners:B}),M=i.create(r,G,V),F=i.create(G,r,Y),x.push(h.create(G)),x.push(R.create(G)),x.push(O.create(G)),x.push(I.create(G)),x.push(b.create(G)),t.useFakeAudio&&x.push(N.create(G))}function U(e){k.debug("creating media handlers"),e.data.type===a.MP4?(x.push(v.create(G)),x.push(C.create(G)),x.push(D.create(G))):x.push(y.create(G)),o.remove({target:G,listeners:B})}function L(e){!t.hasMediaSource||e.data.config.playback.allowSafariHlsFallback&&t.canUseHLS||x.push(g.create(G))}function w(){for(M.destroy(),M=null,F.destroy(),F=null;x.length;)x.pop().destroy()}var M,F,G=new n,k=e.create("MediaManager"),x=[],B=[{type:l.VIDEO_SOURCE,listener:U},{type:m.CONFIG,listener:L}],Y=[{from:p.LOAD_START,to:c.LOAD_START},{from:p.PROGRESS,to:c.PROGRESS},{from:p.SUSPEND,to:c.SUSPEND},{from:p.ABORT,to:c.ABORT},{from:p.EMPTIED,to:c.EMPTIED},{from:p.STALLED,to:c.STALLED},{from:p.PLAY,to:c.PLAY},{from:p.PAUSE,to:c.PAUSE},{from:p.LOADED_META_DATA,to:c.LOADED_META_DATA},{from:p.LOADED_DATA,to:c.LOADED_DATA},{from:p.WAITING,to:c.WAITING},{from:p.ERROR,to:c.ERROR},{from:p.PLAYING,to:c.PLAYING},{from:p.CAN_PLAY,to:c.CAN_PLAY},{from:p.CAN_PLAY_THROUGH,to:c.CAN_PLAY_THROUGH},{from:p.SEEKING,to:c.SEEKING},{from:p.SEEKED,to:c.SEEKED},{from:p.TIME_UPDATE,to:c.TIME_UPDATE},{from:p.ENDED,to:c.ENDED},{from:p.RATE_CHANGE,to:c.RATE_CHANGE},{from:p.DURATION_CHANGE,to:c.DURATION_CHANGE},{from:p.VOLUME_CHANGE,to:c.VOLUME_CHANGE},{from:p.ELEMENT_CREATED,to:c.ELEMENT_CREATED},{from:p.PLAY_START_SUCCESS,to:c.PLAY_START_SUCCESS},{from:p.PLAY_START_ERROR,to:c.PLAY_START_ERROR},{from:p.VIEWPORT_VISIBLE,to:c.VIEWPORT_VISIBLE},{from:p.VIEWPORT_HIDDEN,to:c.VIEWPORT_HIDDEN},{from:E.ERROR,to:c.PLAYBACK_ERROR},{from:E.SUSPENDED,to:c.PLAYBACK_SUSPENDED},{from:A.QUALITY_STATS,to:c.QUALITY_STATS},{from:A.FRAME_DROP,to:c.FRAME_DROP},{from:_.PLAY_STATS,to:c.PLAY_STATS},{from:T.SOURCE_ENDED,to:c.PLAYBACK_FINISHED},{from:T.SOURCE_CLOSED,to:c.PLAYBACK_FINISHED},{from:f.PLAYBACK_STARTED,to:c.PLAYBACK_STARTED},{from:f.BUFFERING,to:c.BUFFERING},{from:S.BUFFER_TWEAKS_CREATED,to:c.BUFFER_TWEAKS_CREATED},{from:S.BUFFER_TWEAKS_ERROR,to:c.BUFFER_TWEAKS_ERROR}],V=[{from:s.CREATE_VIDEO,to:l.CREATE_VIDEO},{from:s.DESTROY_VIDEO,to:l.DESTROY_VIDEO},{from:s.VIDEO_SOURCE,to:l.VIDEO_SOURCE},{from:s.PLAY,to:l.PLAY},{from:s.PAUSE,to:l.PAUSE},{from:s.SEEK,to:l.SEEK},{from:s.MUTE,to:l.MUTE},{from:s.UNMUTE,to:l.UNMUTE},{from:s.SET_VOLUME,to:l.SET_VOLUME},{from:s.SET_RATE,to:l.SET_RATE},{from:s.UPDATE_SOURCE,to:l.UPDATE_SOURCE},{from:s.CONFIG,to:m.CONFIG},{from:d.SERVER_INFO,to:m.SERVER_INFO},{from:d.STREAM_INFO,to:m.STREAM_INFO},{from:d.STREAM_INFO_UPDATE,to:m.STREAM_INFO_UPDATE},{from:d.STREAM_FRAGMENT,
to:m.STREAM_FRAGMENT},{from:d.RANDOM_ACCESS_POINT,to:m.RANDOM_ACCESS_POINT},{from:u.STATE_CHANGE,to:m.APPLICATION_STATE_CHANGE},{from:u.STARTUP_STATS,to:m.STARTUP_STATS},{from:u.DOCUMENT_VISIBLE,to:m.DOCUMENT_VISIBLE},{from:u.DOCUMENT_HIDDEN,to:m.DOCUMENT_HIDDEN}];return P(),{destroy:w}}return{create:P}}.apply(t,r),!(void 0!==o&&(e.exports=o))},function(e,t,n){var r,o;r=[],o=function(){var e="mediaManager.";return{BASE:e,CONFIG:e+"config",SERVER_INFO:e+"serverInfo",STREAM_INFO:e+"streamInfo",STREAM_INFO_UPDATE:e+"streamInfoUpdate",STREAM_FRAGMENT:e+"streamFragment",RANDOM_ACCESS_POINT:e+"randomAccessPoint",APPLICATION_STATE_CHANGE:e+"applicationStateChange",STARTUP_STATS:e+"startupStats",DOCUMENT_VISIBLE:e+"documentVisible",DOCUMENT_HIDDEN:e+"documentHidden"}}.apply(t,r),!(void 0!==o&&(e.exports=o))},function(e,t,n){var r,o;r=[],o=function(){var e="mediaControl.";return{BASE:e,PLAYBACK_STARTED:e+"playbackStarted",BUFFERING:e+"buffering"}}.apply(t,r),!(void 0!==o&&(e.exports=o))},function(e,t,n){var r,o;r=[],o=function(){var e="mediaHandler.";return{BASE:e,ERROR:e+"error",SUSPENDED:e+"suspended"}}.apply(t,r),!(void 0!==o&&(e.exports=o))},function(e,t,n){var r,o;r=[],o=function(){var e="mediaControl.";return{BASE:e,CREATE_VIDEO:e+"createVideo",DESTROY_VIDEO:e+"destroyVideo",VIDEO_SOURCE:e+"videoSource",UPDATE_SOURCE:e+"updateSource",PLAY:e+"play",PAUSE:e+"pause",SEEK:e+"seek",MUTE:e+"mute",UNMUTE:e+"unmute",SET_VOLUME:e+"volume",SET_RATE:e+"playbackRate"}}.apply(t,r),!(void 0!==o&&(e.exports=o))},function(e,t,n){var r,o;r=[],o=function(){var e="mediaElementProxy.";return{BASE:e,LOAD_START:e+"loadstart",PROGRESS:e+"progress",SUSPEND:e+"suspend",ABORT:e+"abort",EMPTIED:e+"emptied",STALLED:e+"stalled",PLAY:e+"play",PAUSE:e+"pause",LOADED_META_DATA:e+"loadedmetadata",LOADED_DATA:e+"loadeddata",WAITING:e+"waiting",ERROR:e+"error",PLAYING:e+"playing",CAN_PLAY:e+"canplay",CAN_PLAY_THROUGH:e+"canplaythrough",SEEKING:e+"seeking",SEEKED:e+"seeked",TIME_UPDATE:e+"timeupdate",ENDED:e+"ended",RATE_CHANGE:e+"ratechange",DURATION_CHANGE:e+"durationchange",VOLUME_CHANGE:e+"volumechange",QUALITY_UPDATE:e+"qualityupdate",ELEMENT_CREATED:e+"elementCreated",PLAY_START_SUCCESS:e+"playStartSuccess",PLAY_START_ERROR:e+"playStartError",VIEWPORT_VISIBLE:e+"viewportvisible",VIEWPORT_HIDDEN:e+"viewporthidden"}}.apply(t,r),!(void 0!==o&&(e.exports=o))},function(e,t,n){var r,o;r=[],o=function(){var e="mediaSourceProxy.";return{BASE:e,SOURCE_OPEN:e+"sourceopen",SOURCE_ENDED:e+"sourceended",SOURCE_CLOSED:e+"sourceclosed",SOURCE_READY:e+"sourceready"}}.apply(t,r),!(void 0!==o&&(e.exports=o))},function(e,t,n){var r,o;r=[],o=function(){var e="qualityHandler.";return{BASE:e,QUALITY_STATS:e+"qualitystats",FRAME_DROP:e+"framedrop"}}.apply(t,r),!(void 0!==o&&(e.exports=o))},function(e,t,n){var r,o;r=[],o=function(){var e="statsCollector.";return{BASE:e,PLAY_STATS:e+"playStats"}}.apply(t,r),!(void 0!==o&&(e.exports=o))},function(e,t,n){var r,o;r=[],o=function(){var e="mediaControl.";return{BASE:e,BUFFER_TWEAKS_CREATED:e+"tweaksCreated",BUFFER_TWEAKS_ERROR:e+"tweaksError"}}.apply(t,r),!(void 0!==o&&(e.exports=o))},function(e,t,n){var r,o;r=[n(26),n(25),n(48),n(15),n(72),n(79),n(74),n(75),n(76),n(71),n(78),n(8)],o=function(e,t,n,r,o,i,a,s,u,c,d,f){function E(E){function l(){r.add({target:E,listeners:B}),T()}function p(){r.remove({target:E,listeners:B}),F&&r.remove({target:E,listeners:Y}),m()}function T(){U.debug("add control listeners"),m(),r.add({target:E,listeners:V})}function m(){U.debug("remove control listeners"),r.remove({target:E,listeners:V})}function A(){_(),U.debug("add play state listeners?"),L&&(U.debug("add play state listeners!"),r.add({target:E,listeners:H}))}function _(){U.debug("remove play state listeners"),r.remove({target:E,listeners:H})}function S(){A()}function h(e){U.debug("buffer tweaks created"),!F&&P===f.PLAYING&&L.buffer.start<e.data.tweaks.buffer.start&&setTimeout(function(){M=!0,E.emit(o.BUFFERING),U.debug("new tweaks, pausing to raise buffer"),E.emit(a.PAUSE)},10),L.buffer=e.data.tweaks.buffer}function R(){P===f.LOADING&&(U.debug("hls: canplaythrough while loading, wait for progress"),E.emit(a.PLAY,{external:!1}),G=!0)}function O(){(P===f.BUFFERING||P===f.LOADING&&G)&&(U.debug("hls: progress at buffering or after canplaythrough while loading, continue"),G=!1,M=!1,E.emit(o.PLAYBACK_STARTED,x?{stats:x}:{}))}function g(){P===f.PLAYING&&(U.debug("hls: waiting while playing, now buffering"),M=!0,E.emit(o.BUFFERING))}function N(e){U.debug("video source"),F=e.data.type===n.HLS,F&&(A(),r.add({target:E,listeners:Y}))}function v(e){switch(P=e.data.state){case f.PLAYING:x=null;break;case f.LOADING:break;case f.PAUSED:_();break;case f.PAUSING:_(),U.warn("entering paused state"),k=-1,w=!1,M=!0}}function y(e){x=e.data.stats}function I(){m(),E.emit(a.PLAY,{external:!1}),T()}function C(e){F||k!==-1||setTimeout(function(){U.debug("pausing to raise buffer"),E.emit(a.PAUSE)},10)}function b(e){if(!e.data.buffered||!e.data.buffered.length)return void U.debug("no data in play stats");var n=e.data.stats,r=n.buffer.delay.current>L.buffer.start,i=n.buffer.delay.current>L.buffer.min,s=n.buffer.end-n.buffer.start,u=e.data.currentTime,c=e.data.buffered,d=D(c,u)!==-1;if(!F&&!d&&!w&&s>.45){var f=c.length,l=Math.min(c.start(f-1)+.3,c.end(f-1));return U.warn("seek to range: "+c.start(f-1)+" < "+l+" > "+c.end(f-1)),void E.emit(a.SEEK,{position:t.isTridentBrowser?0:l})}if(!F&&!w&&t.isFirefox&&c.length>1&&D(c,u)!==c.length-1&&c.end(f-1)-c.start(f-1)>.3){var f=c.length,l=c.start(f-1);return U.warn("seek to startable range start: "+c.start(f-1)),void E.emit(a.SEEK,{position:l})}if(r&&k===-1&&d){if(k=u,!F&&t.isSafari&&k<.2)return k=.3,U.warn("initial safari stream startTime set to "+k+", seeking"),void E.emit(a.SEEK,{position:k});U.debug("stream startTime set to "+k)}M&&r&&(F?F&&G&&(U.debug("hls: buffering and has enough to start, don't wait for progress"),G=!1):(U.debug("starting stream"),I()),M=!1,w&&E.emit(o.PLAYBACK_STARTED,x?{stats:x}:{})),M||(!w&&k!==-1&&k<u-.1&&(w=!0,F&&G&&(U.debug("hls: current time rising and started, don't wait for progress"),G=!1),E.emit(o.PLAYBACK_STARTED,x?{stats:x}:{})),u>L.buffer.start&&!i&&(M=!0,F||(U.debug("pausing to buffer"),E.emit(a.PAUSE)),E.emit(o.BUFFERING)))}function D(e,n){for(var r=0;e&&r<e.length;++r)if(e.start(r)<=n&&e.end(r)>=n||t.isTridentBrowser&&n<=.3&&e.start(r)<=5&&e.end(r)-e.start(r)>.2)return r;return-1}var P,U=e.create("BufferControl"),L={},w=!1,M=!0,F=!1,G=!1,k=-1,x=null,B=[{type:c.APPLICATION_STATE_CHANGE,listener:v},{type:c.STARTUP_STATS,listener:y},{type:a.VIDEO_SOURCE,listener:N},{type:u.SOURCE_READY,listener:S},{type:i.BUFFER_TWEAKS_CREATED,listener:h}],Y=[{type:s.CAN_PLAY_THROUGH,listener:R},{type:s.PROGRESS,listener:O},{type:s.WAITING,listener:g}],V=[{type:a.PLAY,listener:C}],H=[{type:d.PLAY_STATS,listener:b}];return l(),{destroy:p}}return{create:E}}.apply(t,r),!(void 0!==o&&(e.exports=o))},function(e,t,n){var r,o;r=[n(26),n(22),n(25),n(82),n(15),n(72),n(79),n(77),n(71),n(78),n(83)],o=function(e,t,n,r,o,i,a,s,u,c,d){function f(f){function E(){D.debug("initialize"),p(),o.add({target:f,listeners:B})}function l(){y=null,[B,Y,V].forEach(function(e){o.remove({target:f,listeners:e})})}function p(){y=r.create(10*F)}function T(e){o.add({target:f,listeners:e?V:Y}),o.remove({target:f,listeners:e?Y:V})}function m(e){if(e.data.onStreamInfo.videoInfo&&e.data.onStreamInfo.haveVideo&&e.data.onStreamInfo.videoInfo.frameRate<=30&&n.isTridentBrowser&&!x){var r=1;U=t.copy(P),g(Math.sqrt(30)-Math.sqrt(e.data.onStreamInfo.videoInfo.frameRate),r),U.start+=(U.target-U.start)/2,U.min+=(U.start-U.min)/2,N()}}function A(e){m(e)}function _(e){I=n.mustUseHLS||e.data.config.playback.allowSafariHlsFallback&&n.canUseHLS,I||o.add({target:f,listeners:V});var r;e.data.config.tweaks&&(e.data.config.tweaks.buffer&&(r=d.validateBuffer(e.data.config.tweaks.buffer),r.success?(U=t.copy(e.data.config.tweaks.buffer),L=t.copy(U),x=!0):f.emit(a.BUFFER_TWEAKS_ERROR,{reason:r.reason})),e.data.config.tweaks.bufferDynamic&&!I&&(r=d.validateDynamic(e.data.config.tweaks.bufferDynamic),r.success?(w=e.data.config.tweaks.bufferDynamic.offsetThreshold,M=e.data.config.tweaks.bufferDynamic.offsetStep,F=e.data.config.tweaks.bufferDynamic.cooldownTime):f.emit(a.BUFFER_TWEAKS_ERROR,{reason:r.reason}))),N()}function S(e){var t=e.data.stats.buffer.delay.current;t&&y.add(t),!k&&n.isTridentBrowser&&t>C&&(U.target=t,U.limit=U.target+b,N()),k=!0}function h(){T(!0);var e=((new Date).getTime()-G)/1e3;G!==-1&&e<w&&U.start<L.limit&&(D.warn("buffering "+e+" seconds after stream started, raising buffer values"),g(M),N()),p(),clearInterval(v),v=0}function R(){T(!1),G=(new Date).getTime(),k&&F&&(v=setInterval(function(){D.debug("stream running stable since "+F+" sec"),D.debug("buffer min: "+y.minimum+", max: "+y.maximum),U.start>L.start?(D.debug(-M+" sec cooldown"),g(-M),N()):(D.debug("no cooldown"),clearInterval(v),v=0)},1e3*F))}function O(e){n.isFirefox&&(D.debug("frame drop"),D.debug(""+JSON.stringify(e)),D.debug("current buffer: "+JSON.stringify(U)),D.debug("limit: "+L.limit+", start: "+U.start),U.start<L.limit?(D.debug("start lower then limit -> tweaking"),g(U.target-U.start),N()):D.debug("start higher then limit -> tweaking denied"))}function g(e,t){t=t||1,["start","target","limit"].forEach(function(n){U[n]*=t,U[n]+=e})}function N(){D.debug("new buffer: "+JSON.stringify(U)),f.emit(a.BUFFER_TWEAKS_CREATED,{tweaks:{buffer:t.copy(U)}})}var v,y,I,C=2,b=1.5,D=e.create("BufferTweaker"),P={max:8,min:.2,start:.5,target:1.2,limit:1.7},U=t.copy(P),L=t.copy(P),w=0,M=0,F=0,G=-1,k=!1,x=!1,B=[{type:u.STREAM_INFO,listener:m},{type:u.STREAM_INFO_UPDATE,listener:A},{type:u.CONFIG,listener:_},{type:s.FRAME_DROP,listener:O}],Y=[{type:c.PLAY_STATS,listener:S},{type:i.BUFFERING,listener:h}],V=[{type:i.PLAYBACK_STARTED,listener:R}];return E(),{destroy:l}}return{create:f}}.apply(t,r),!(void 0!==o&&(e.exports=o))},function(e,t,n){var r,o;r=[],o=function(){function e(e){return e.reduce(function(e,t){return e+t},0)/e.length}function t(e){return Math.pow(e.reduce(function(e,t){return e?t?e*t:e:t},0),1/e.length)}function n(e){var t=e.reduce(function(e,t,n){return t?n-1?e+1/t:(e?1/e:0)+1/t:e},0);return t?e.length/t:0}function r(r){function o(e){for(a.push(e);a.length>r;)a.shift();return i(),{minimum:s.min,maximum:s.max,arithmetic:s.arithmetic,geometric:s.geometric,harmonic:s.harmonic}}function i(){var r=JSON.parse(JSON.stringify(a)).sort(function(e,t){return e-t},0);s.arithmetic=e(r),s.geometric=t(r),s.harmonic=n(r),s.minimum=r[0],s.maximum=r[r.length-1]}var a=[],s={};return s={add:o,minimum:0,maximum:0,arithmetic:0,geometric:0,harmonic:0,values:a}}return{create:r}}.apply(t,r),!(void 0!==o&&(e.exports=o))},function(e,t,n){var r,o;r=[],o=function(){function e(e){var t=["min","start","target","limit","max"],n=t.filter(function(t){return!e.hasOwnProperty(t)});if(n.length)return{success:!1,reason:"The buffer config is invalid, it must contain "+n.join(", ")+". Reset to default."};for(var r in t)if(t.hasOwnProperty(r)){if("number"!=typeof e[t[r]])return{success:!1,reason:"The buffer config is invalid, the value '"+t[r]+"' have to be a number. Reset to default."};if(r>0&&e[t[r-1]]>e[t[r]])return{success:!1,reason:"The buffer config is invalid, the value '"+t[r-1]+"' have to be lower then '"+t[r]+"'. Reset to default."}}return{success:!0}}function t(e){var t=["offsetThreshold","offsetStep","cooldownTime"],n=t.filter(function(t){return!e.hasOwnProperty(t)});return n.length?{success:!1,reason:"The dynamic buffer config is invalid, it must contain "+n.join(", ")+". Reset to default."}:(t.forEach(function(t){if("number"!=typeof e[t]||0===e[t])return{success:!1,reason:"The dynamic buffer config is invalid, the value '"+t+"' have to be a number. Reset to default."}}),{success:!0})}return{validateBuffer:e,validateDynamic:t}}.apply(t,r),!(void 0!==o&&(e.exports=o))},function(e,t,n){var r,o;r=[n(26),n(25),n(85),n(15),n(86),n(87),n(74),n(71),n(75)],o=function(e,t,n,r,o,i,a,s,u){function c(c){function E(){r.add({target:c,listeners:j});var e=[i.TIME_UPDATE];for(var t in i)i.hasOwnProperty(t)&&e.indexOf(i[t])===-1&&q.push({type:i[t],listener:v})}function l(){r.remove({target:c,listeners:j}),m()}function p(e){k=t.mustUseHLS||e.data.config.playback.allowSafariHlsFallback&&t.canUseHLS,e.data.config.playback&&(V=!!e.data.config.playback.muted,H=!!e.data.config.playback.automute)}function T(e){if(D=document.getElementById(e.data.elementId),B=!!D,x.debug("using "+(B?"external ":"generated ")+"video eleement"),P=e.data.container,D?(w=D.parentElement,L=D.style.cssText,D.style.cssText=""):(D=document.createElement("video"),D.id=e.data.elementId,D.autoplay=!1,D.controls=!1,D.setAttribute("playsinline",!0),D.style.backgroundColor="transparent"),D.muted=V,D.volume=K,U=document.createElement("source"),D.appendChild(U),t.isIOS11||!t.isIOS&&t.mustUseHLS){x.debug("iOS11 detected, using iframe hack"),D.style.width="100vw",D.style.height="100vh";var n=document.createElement("iframe");n.frameBorder=0,n.scrolling="no",n.style.cssText="width: 100%;height: 100%;position: absolute;display: block;top: 0;left: 0;",n.addEventListener("load",function(e){e.target.contentDocument.body.style.height="100%",e.target.contentDocument.body.style.width="100%",e.target.contentDocument.body.style.overflow="hidden",e.target.contentDocument.body.style.position="absolute",e.target.contentDocument.body.style.margin="0",e.target.contentDocument.body.style.padding="0",e.target.contentDocument.body.firstChild||(e.target.contentDocument.body.appendChild(D),r.remove({target:D,listeners:q}),r.add({target:D,listeners:q}))}),n.addEventListener("unload",function(e){e.target.contentDocument.body.firstChild&&e.target.contentDocument.body.removeChild(D)}),P.appendChild(n)}else x.debug("appending video to container"),P.appendChild(D),r.add({target:D,listeners:q});t.isTridentBrowser&&(["scroll","resize"].forEach(function(e){window.addEventListener&&addEventListener(e,C,!1),window.attachEvent&&attachEvent("on"+e,C)}),C()),c.emit(u.ELEMENT_CREATED,{video:D}),c.emit(u.VOLUME_CHANGE,{muted:D.muted,volume:D.volume})}function m(){if(D){for(r.remove({target:D,listeners:q}),t.isTridentBrowser&&(G=void 0,["scroll","resize"].forEach(function(e){window.removeEventListener&&removeEventListener(e,C,!1),window.detachEvent&&detachEvent("on"+e,C)})),k&&(U.src="",D.load());P.firstChild;)P.removeChild(P.firstChild);for(;D.firstChild;)D.removeChild(D.firstChild);B&&(x.debug("releasing external video"),D.style.cssText=L,L=null,w.appendChild(D)),clearInterval(M),clearInterval(F),D=null}}function A(e){x.debug("received video source"),D&&(x.debug("src: "+e.data.src),x.debug("type: "+e.data.type),U.src=e.data.src,D.type=e.data.type,D.load(),Y&&D.play(),clearInterval(M),clearInterval(F),e.data.src&&e.data.src.length&&(x.debug("add time update interval for play stats"),M=setInterval(y,d),"function"==typeof D.getVideoPlaybackQuality&&(x.debug("add quality update interval"),F=setInterval(I,f))))}function _(){x.debug("mute"),V=!0,D&&(D.muted=!0)}function S(){x.debug("unmute"),V=!1,D&&(D.muted=!1)}function h(e){x.debug("onPlay"),D&&n.play(D).then(function(){x.debug("play promise resolved"),c.emit(u.PLAY_START_SUCCESS),W=!1,Y=!0}).catch(function(t){x.debug("play promise rejected"),t.error.name!==o.NOT_ALLOWED_ERROR||D.muted||!H||W?D.muted&&W&&(x.debug("unmute to reset"),S(),D.muted||(v({type:i.VOLUME_CHANGE}),W=!1)):(x.debug("mute to play"),_(),D.muted&&(W=!0,setTimeout(h.bind(null,{data:{external:!1}}),20))),e.data.external&&!W||c.emit(u.PLAY_START_ERROR,{error:t.error,automuted:W})})}function R(){if(x.debug("onPause"),D&&(D.pause(),Y=!1,g({data:{rate:1}}),t.isIOS11||!t.isIOS&&t.mustUseHLS))for(var e=0;e<P.children.length;e+=1){var n=P.children[e];n&&n.tagName&&"IFRAME"===n.tagName&&n.contentWindow.location.reload(!0)}}function O(e){K=Math.min(1,Math.max(0,e.data.volume)),D&&D.volume!==K&&(x.debug("set volume: "+e.data.volume),D.volume=K)}function g(e){D&&D.playbackRate!==e.data.rate&&(x.debug("set rate to: "+e.data.rate),D.playbackRate=e.data.rate)}function N(e){D&&(x.debug("seek to: "+e.data.position),D.currentTime=e.data.position)}function v(e){var t=b();switch(e.type){case i.ERROR:t.code=D.error.code;break;case i.VOLUME_CHANGE:t.muted=D.muted,t.volume=D.volume;break;case i.CAN_PLAY:t.haveVideo="undefined"!=typeof D.videoTracks&&D.videoTracks.length>0,t.haveAudio="undefined"!=typeof D.audioTracks&&D.audioTracks.length>0,t.videoWidth=D.videoWidth,t.videoHeight=D.videoHeight}x.detail(e.type),c.emit("mediaElementProxy."+e.type,t)}function y(){c.emit(u.TIME_UPDATE,b())}function I(){var e=b();e.quality=D.getVideoPlaybackQuality(),c.emit(u.QUALITY_UPDATE,e)}function C(){var e=D&&"function"==typeof D.getBoundingClientRect?D.getBoundingClientRect():{top:0,left:0,bottom:0,right:0},t=window.innerHeight||document.documentElement.clientHeight,n=window.innerWidth||document.documentElement.clientWidth,r=e.top<=t&&e.top+e.height>=0,o=e.left<=n&&e.left+e.width>=0,i=r&&o;i!==G&&(x.debug("viewport changed to "+(i?"visible":"hidden")),G=i,c.emit(i?u.VIEWPORT_VISIBLE:u.VIEWPORT_HIDDEN))}function b(){return{currentTime:D.currentTime,buffered:D.buffered,played:D.played,playbackRate:D.playbackRate}}var D,P,U,L,w,M,F,G,k,x=e.create("MediaElementProxy"),B=!1,Y=!1,V=!1,H=!1,W=!1,K=1,j=[{type:s.CONFIG,listener:p},{type:a.CREATE_VIDEO,listener:T},{type:a.DESTROY_VIDEO,listener:m},{type:a.VIDEO_SOURCE,listener:A},{type:a.PLAY,listener:h},{type:a.PAUSE,listener:R},{type:a.SEEK,listener:N},{type:a.MUTE,listener:_},{type:a.UNMUTE,listener:S},{type:a.SET_VOLUME,listener:O},{type:a.SET_RATE,listener:g}],q=[];return E(),{destroy:l}}var d=100,f=1e3;return{create:c}}.apply(t,r),!(void 0!==o&&(e.exports=o))},function(e,t,n){var r,o;r=[],o=function(){function e(e){return new Promise(function(r,o){var i=e.play();Promise.all([i]).then(function(t){r({media:e})}).catch(function(r){t=r&&r.name?r.name:"Unknown",n=r&&r.message?r.message:"Message not available.",o({media:e,error:{name:t,message:n}})})})}var t,n;return{play:e}}.apply(t,r),!(void 0!==o&&(e.exports=o))},function(e,t,n){var r,o;r=[],o=function(){return{ABORT_ERROR:"AbortError",NOT_ALLOWED_ERROR:"NotAllowedError"}}.apply(t,r),!(void 0!==o&&(e.exports=o))},function(e,t,n){var r,o;r=[],o=function(){var e="";return{BASE:e,LOAD_START:e+"loadstart",PROGRESS:e+"progress",SUSPEND:e+"suspend",ABORT:e+"abort",EMPTIED:e+"emptied",STALLED:e+"stalled",PLAY:e+"play",PAUSE:e+"pause",LOADED_META_DATA:e+"loadedmetadata",LOADED_DATA:e+"loadeddata",WAITING:e+"waiting",ERROR:e+"error",PLAYING:e+"playing",CAN_PLAY:e+"canplay",CAN_PLAY_THROUGH:e+"canplaythrough",SEEKING:e+"seeking",SEEKED:e+"seeked",TIME_UPDATE:e+"timeupdate",ENDED:e+"ended",RATE_CHANGE:e+"ratechange",DURATION_CHANGE:e+"durationchange",VOLUME_CHANGE:e+"volumechange"}}.apply(t,r),!(void 0!==o&&(e.exports=o))},function(e,t,n){var r,o;r=[n(26),n(15),n(48),n(89),n(74),n(75),n(71),n(76),n(90)],o=function(e,t,n,r,o,i,a,s,u){function c(c){function d(){v.debug("create"),t.add({target:c,listeners:b}),f()}function f(){v.debug("create mediasource"),g=new window.MediaSource,t.add({target:g,listeners:D}),P.push(u.create(c,g,y.timestampReset,C,I?N:null))}function E(){if(g){for(v.debug("destroy mediasource"),t.remove({target:g,listeners:D});P.length;)P.pop().destroy();g=null}}function l(){v.debug("bind mediasource"),c.emit(o.VIDEO_SOURCE,{src:window.URL.createObjectURL(g),type:n.MP4})}function p(){E(),f(),l()}function T(){v.debug("destroy"),E(),t.remove({target:c,listeners:b})}function m(e){C=0,N&&N.onStreamInfo.mimeType!=e.data.onStreamInfo.mimeType?(v.debug("new mime type received"),N=e.data,C=g&&g.activeSourceBuffers.length&&g.activeSourceBuffers[g.activeSourceBuffers.length-1].buffered.length?g.activeSourceBuffers[g.activeSourceBuffers.length-1].buffered.end(g.activeSourceBuffers[g.activeSourceBuffers.length-1].buffered.length-1):0,I=!0,p(),I=!1):N=e.data}function A(e){y=e.data.options}function _(){l()}function S(){v.debug("open"),c.emit(s.SOURCE_OPEN,O())}function h(){v.debug("ended"),p(),c.emit(s.SOURCE_ENDED,O())}function R(){v.debug("closed"),p(),c.emit(s.SOURCE_CLOSED,O())}function O(){return{readyState:g.readyState}}var g,N,v=e.create("MediaSourceProxy"),y={timestampReset:!1},I=!1,C=0,b=[{type:a.STREAM_INFO,listener:m},{type:a.STREAM_INFO_UPDATE,listener:m},{type:o.UPDATE_SOURCE,listener:A},{type:i.ELEMENT_CREATED,listener:_}],D=[{type:r.SOURCE_OPEN,listener:S},{type:r.SOURCE_ENDED,listener:h},{type:r.SOURCE_CLOSED,listener:R}],P=[];return d(),{destroy:T}}return{create:c}}.apply(t,r),!(void 0!==o&&(e.exports=o))},function(e,t,n){var r,o;r=[],o=function(){var e="";return{BASE:e,SOURCE_OPEN:e+"sourceopen",SOURCE_ENDED:e+"sourceended",SOURCE_CLOSED:e+"sourceclosed"}}.apply(t,r),!(void 0!==o&&(e.exports=o))},function(e,t,n){var r,o;r=[n(26),n(25),n(15),n(91),n(89),n(74),n(75),n(71),n(76),n(8)],o=function(e,t,n,r,o,i,a,s,u,c){function d(d,f,E,l,p){function T(){n.add({target:d,listeners:ae}),p&&(X=!0,D({data:p}))}function m(){for(;J.length;)J.pop();n.remove({target:d,listeners:ae}),n.remove({target:d,listeners:se}),G&&n.remove({target:G,listeners:ue}),f.removeEventListener(o.SOURCE_OPEN,P),G=null}function A(e){k=e.data.currentTime,x!==c.PAUSED&&Y.debug("current time "+k)}function _(e){if(!oe){for(var t=["moov","ftyp"],n="",r=4;r<8;++r)n+=String.fromCharCode(e.data[r]);if(t.indexOf(n)===-1)return void Y.debug("dropping fragment: "+n);Y.debug("initialized with "+n),oe=!0}R(e.data)}function S(e){if(Y.debug("random access point streamtime "+e.data.onRandomAccessPoint.streamTime),!oe){ie=Math.floor(e.data.onRandomAccessPoint.streamTime)/1e3,Y.debug("set start time to random access point");var t=parseFloat(ie.toString());G&&G.buffered.length&&(ie=-1),t>0?(Y.debug("from stream info update"),E&&(v(-t),j=0,O(0,1/0))):0===t&&(Y.debug("from stream info"),E?(j=0,O(0,1/0),v(0)):v(l)),G&&G.buffered.length&&(Y.debug("have buffer and start time"),t>0?(Y.debug("from stream info update"),E&&N(0)):0===t&&(Y.debug("from stream info"),E?N(t):v(G.buffered.end(G.buffered.length-1))))}}function h(e){E=e.data.options.timestampReset}function R(e){y({command:Q,fragment:e})}function O(e,t){y({command:Z,from:e,to:t})}function g(){y({command:$,zeroing:t.isTridentBrowser&&!isNaN(f.duration)&&f.duration>0})}function N(e){y({command:ee,position:e})}function v(e){y({command:te,offset:e})}function y(e){e.count=q++,X?I(e):C(e)}function I(e){if(Y.debug("queue "+e.command+" "+e.count),e.force)J.unshift(e);else if(e.command===Q&&J.length&&J[J.length-1].command===Q){if(z+1<K){var t=J[J.length-1].fragment,n=e.fragment,r=new Uint8Array(t.byteLength+n.byteLength);r.set(new Uint8Array(t),0),r.set(new Uint8Array(n),t.byteLength),J[J.length-1].fragment=r,J[J.length-1].count=J[J.length-1].count.toString()+" & "+e.count,z++}else z=0,Y.debug("joined fragments threshold ("+K+") reached so begin new one"),J.push(e);Y.debug("joined fragments count "+z)}else z=0,Y.debug("joined fragments count "+z),J.push(e)}function C(e){Y.debug("execute "+e.command+" "+e.count);var t="ranges ";if(G.buffered.length)for(var n=0,r=G.buffered.length;n<r;n+=1)t+=n+" "+G.buffered.start(n)+" - "+G.buffered.end(n),n!==r-1&&(t+=", ");else t+="0";switch(Y.debug(t),e.command){case Q:X=!0,ne?(Y.debug("append "+e.count),G.appendBuffer(e.fragment),F()||j++):b();break;case Z:X=!0,G.buffered.length&&G.buffered.end(G.buffered.length-1)>0?(G.remove(e.from,e.to),Y.debug("removed buffer from "+e.from+" to "+e.to+" "+e.count)):b();break;case $:X=!0,re=1,Y.debug("append enabled after reset"),ne=!0,e.zeroing?(Y.debug("zeroing mse duration"),f.duration=0):b();break;case ee:X=!0,Y.debug("seek to position "+e.position+" "+e.count),d.emit(i.SEEK,{position:e.position}),b();break;case te:X=!0,G&&(Y.debug("offset "+e.offset+" "+e.count),G.timestampOffset=e.offset),b()}}function b(){if(ie>-1&&G&&G.buffered.length){var e=parseFloat(ie.toString());ie=-1,Y.debug("have buffer and start time on update end"),e>0?(Y.debug("from stream info update"),N(E?0:e)):0===e&&(Y.debug("from stream info"),N(E?e:l))}X=!1,re&&(re=0,Y.debug("source ready"),d.emit(u.SOURCE_READY)),J.length?C(J.shift()):M()&&F()&&(Y.debug("remove buffer"),O(G.buffered.start(0),k-H))}function D(e){Y.debug("stream info"),p=e.data.onStreamInfo,B=p&&p.mimeType?p.mimeType:'video/mp4; codecs="avc1.42E01E, mp4a.40.2"',f&&"open"===f.readyState?[c.PLAYING,c.BUFFERING].indexOf(x)!==-1?oe=!1:G?g():(Y.debug("init sourcebuffer after stream info"),U()):(Y.debug("add source open listener after stream info"),f.addEventListener(o.SOURCE_OPEN,P))}function P(){Y.debug("mediasource open"),f.removeEventListener(o.SOURCE_OPEN,P),Y.debug("init sourcebuffer"),U(B)}function U(){!G&&f&&"open"===f.readyState&&(Y.debug("create source buffer with mime type '"+B+"'"),G=f.addSourceBuffer(B),n.add({target:d,listeners:se}),n.add({target:G,listeners:ue}),Y.debug("append enabled init source buffer"),ne=!0,X&&b(),d.emit(u.SOURCE_READY))}function L(e){x=e.data.state,x===c.PAUSED&&w()}function w(){for(Y.debug("pause"),oe=!1,ne=!1;J.length;)J.pop();O(0,1/0),j=0,l=0}function M(){return G.buffered.length&&G.buffered.start(0)<k-V}function F(){return W<j}var G,k,x,B,Y=e.create("SourceBufferQueue "+(new Date).toLocaleTimeString()),V=30,H=20,W=300,K=30,j=0,q=0,z=0,X=!1,J=[],Q="append",Z="remove",$="reset",ee="seek",te="offset",ne=!1,p=p||void 0,E=!!E,re=0,oe=!1,ie=-1,l=l||0,ae=[{type:s.STREAM_INFO,listener:D},{type:s.STREAM_INFO_UPDATE,listener:D},{type:s.STREAM_FRAGMENT,listener:_},{type:s.RANDOM_ACCESS_POINT,listener:S},{type:i.UPDATE_SOURCE,listener:h}],se=[{type:a.TIME_UPDATE,listener:A},{type:s.APPLICATION_STATE_CHANGE,listener:L}],ue=[{type:r.UPDATE_END,listener:b}];return T(),{destroy:m}}return{create:d}}.apply(t,r),!(void 0!==o&&(e.exports=o))},function(e,t,n){var r,o;r=[],o=function(){var e="";return{BASE:e,ABORT:e+"abort",ERROR:e+"error",UPDATE:e+"update",UPDATE_START:e+"updatestart",UPDATE_END:e+"updateend"}}.apply(t,r),!(void 0!==o&&(e.exports=o))},function(e,t,n){var r,o;r=[n(26),n(15),n(74),n(71)],o=function(e,t,n,r){function o(o){function i(){d.debug("initialize"),t.add({target:o,listeners:f})}function a(){u(),t.remove({target:o,listeners:f})}function s(e){u(),e.data.onStreamInfo.haveAudio||(window.AudioContext=window.AudioContext||window.webkitAudioContext||function(){return{close:function(){}}},c=new AudioContext)}function u(){c&&"function"==typeof c.close&&(c.close(),c=null)}var c,d=e.create("FakeAudioContext"),f=[{type:r.STREAM_INFO,listener:s},{type:n.PAUSE,listener:u}];return i(),{destroy:a}}return{create:o}}.apply(t,r),!(void 0!==o&&(e.exports=o))},function(e,t,n){var r,o;r=[n(26),n(25),n(15),n(74),n(71),n(75),n(8)],o=function(e,t,n,r,o,i,a){function s(s){function u(){R.debug("initialize"),n.add({target:s,listeners:g})}function c(){n.remove({target:s,listeners:g}),n.remove({target:s,listeners:N})}function d(e){m=e.data.state,n.remove({target:s,listeners:N}),(t.isTridentBrowser&&m===a.PLAYING||!t.isTridentBrowser&&m!==a.PAUSED)&&n.add({target:s,listeners:N})}function f(e){var t=l(e.data.currentTime,e.data.buffered),n=p(e.data.currentTime,e.data.buffered);if(A===e.data.currentTime){if(O++,O<_)return;if(n>t&&T(e.data.buffered,n)>h&&E(e.data.currentTime,e.data.buffered)){var o=e.data.buffered.start(p(e.data.currentTime,e.data.buffered));R.debug("recover gap, seek to "+o,3),s.emit(r.SEEK,{position:o}),s.emit(r.PLAY,{external:!1})}}A=e.data.currentTime,O=0}function E(e,t){return e+S>=t.end(l(e,t))}function l(e,t){for(var n=0;n<t.length-1&&t.start(n+1)<=e;)n++;return n}function p(e,t){for(var n=0;n<t.length-1&&t.start(n)<=e;)n++;return n}function T(e,t){return t<e.length?e.end(t)-e.start(t):0}var m,A,_=10,S=.2,h=.5,R=e.create("GapHandler"),O=0,g=[{type:o.APPLICATION_STATE_CHANGE,listener:d}],N=[{type:i.TIME_UPDATE,listener:f}];return u(),{destroy:c}}return{create:s}}.apply(t,r),!(void 0!==o&&(e.exports=o))},function(e,t,n){var r,o;r=[n(26),n(22),n(15),n(73),n(71),n(78),n(8)],o=function(e,t,n,r,o,i,a){function s(s){function u(){p.debug("initialize"),n.add({target:s,listeners:T})}function c(){n.remove({target:s,listeners:T})}function d(e){n.remove({target:s,listeners:m});var t=e.data.state;switch(t){case a.PAUSED:case a.PAUSING:p.debug("entering paused state"),E=null;break;case a.PLAYING:n.add({target:s,listeners:m})}}function f(e){if(E&&"undefined"!=typeof E.currentTime&&e.data.stats.currentTime<E.currentTime-l){var n={currentTime:{last:E.currentTime,current:e.data.stats.currentTime}};s.emit(r.ERROR,n)}E=t.copy(e.data.stats)}var E,l=2,p=e.create("HLSJumpHandler"),T=[{type:o.APPLICATION_STATE_CHANGE,listener:d}],m=[{type:i.PLAY_STATS,listener:f}];return u(),{destroy:c}}return{create:s}}.apply(t,r),!(void 0!==o&&(e.exports=o))},function(e,t,n){var r,o;r=[n(10),n(26),n(25),n(15),n(73),n(74),n(71),n(75),n(8)],o=function(e,t,n,r,o,i,a,s,u){function c(c){function d(){_.debug("initialize"),r.add({target:c,listeners:R})}function f(){r.remove({target:c,listeners:R})}function E(t){h=t.name===a.DOCUMENT_HIDDEN,_.debug(h?"hidden":"visible"),h&&e.mobile&&(m===u.PLAYING||m===u.LOADING||m===u.BUFFERING)&&c.emit(o.SUSPENDED)}function l(t){var n=t.data.buffered.length?t.data.buffered.end(0)-t.data.currentTime:"n.a.";(A&&t.name===s.PAUSE||h&&e.mobile)&&m===u.PLAYING?c.emit(o.SUSPENDED):S||(S=setTimeout(function(){m===u.PLAYING&&(_.debug("nanoplayer: recover unexpected pause type "+t.name+", delay = "+n,3),c.emit(i.PLAY,{external:!1})),S=0},200))}function p(e){m=e.data.state}function T(e){A=n.mustUseHLS||e.data.config.playback.allowSafariHlsFallback&&n.canUseHLS}var m,A,_=t.create("PauseHandler"),S=0,h=!1,R=[{type:s.PAUSE,listener:l},{type:s.WAITING,listener:l},{type:s.ENDED,listener:l},{type:a.APPLICATION_STATE_CHANGE,listener:p},{type:a.CONFIG,listener:T},{type:a.DOCUMENT_VISIBLE,listener:E},{type:a.DOCUMENT_HIDDEN,listener:E}];return d(),{destroy:f}}return{create:c}}.apply(t,r),!(void 0!==o&&(e.exports=o))},function(e,t,n){var r,o;r=[n(26),n(15),n(8),n(74),n(71),n(75),n(77)],o=function(e,t,n,r,o,i,a){function s(r){function s(){t.add({target:r,listeners:C})}function u(){t.remove({target:r,listeners:C}),t.remove({target:r,listeners:b})}function c(){for(_={droppedVideoFrames:0,droppedVideoFramesCurrent:0,corruptedVideoFrames:0,corruptedVideoFramesCurrent:0,creationTime:0,totalVideoFrames:0};N.length;)N.pop()}function d(e){S=e.data.state,S===n.PAUSED?p():!I&&v&&S===n.PLAYING&&l()}function f(e){v=e.data.onStreamInfo.haveVideo&&(y=e.data.onStreamInfo.videoInfo.frameRate)}function E(e){f(e)}function l(){p(),t.add({target:r,listeners:b}),I=setInterval(m,R)}function p(){clearInterval(I),t.remove({target:r,listeners:b}),I=0,c()}function T(e){for(var t in e.data.quality)if(_.hasOwnProperty(t)){if("droppedVideoFrames"===t){for(_.droppedVideoFramesCurrent=e.data.quality.droppedVideoFrames-_.droppedVideoFrames;N.length>g-1;)N.shift();N.push({count:_.droppedVideoFramesCurrent,time:e.data.currentTime})}"corruptedVideoFrames"===t&&(_.corruptedVideoFramesCurrent=e.data.quality.corruptedVideoFrames-_.corruptedVideoFrames),_[t]=e.data.quality[t]}r.emit(a.QUALITY_STATS,_)}function m(){if(S===n.PLAYING){var e=A("extreme");if(!e&&(e=A("high")),!e&&(e=A("medium")),e){for(h.debug("frame drop detected with type '"+e.type+"'"),h.debug(e.frames.dropped+" frames in last "+e.samples.all.length+" seconds dropped");N.length;)N.pop();r.emit(a.FRAME_DROP,e)}}}function A(e){if(N.length>O[e].samplesRange-1){var t=N.slice(-O[e].samplesRange),n=t.filter(function(t){return t.count>=y*O[e].ratioThreshold});if(n.length>O[e].samplesMatchAllowed){var r=0;return t.forEach(function(e){r+=e.count}),{type:e,framerate:y,samples:{all:t,matched:n,limit:Math.ceil(y*O[e].ratioThreshold)},frames:{dropped:r}}}}return!1}var _,S,h=e.create("QualityHandler"),R=1e3,O={extreme:{ratioThreshold:.95,samplesRange:3,samplesMatchAllowed:1},high:{ratioThreshold:.2,samplesRange:5,samplesMatchAllowed:1},medium:{ratioThreshold:.1,samplesRange:10,samplesMatchAllowed:3}},g=10,N=[],v=!1,y=0,I=0,C=[{type:o.APPLICATION_STATE_CHANGE,listener:d},{type:o.STREAM_INFO,listener:f
},{type:o.STREAM_INFO_UPDATE,listener:E}],b=[{type:i.QUALITY_UPDATE,listener:T}];return s(),{destroy:u}}return{create:s}}.apply(t,r),!(void 0!==o&&(e.exports=o))},function(e,t,n){var r,o;r=[n(35),n(15),n(26),n(25),n(82),n(8),n(71),n(74),n(75),n(78)],o=function(e,t,n,r,o,i,a,s,u,c){function d(s){function d(){h(),t.add({target:s,listeners:L}),t.add({target:s,listeners:w})}function f(){t.remove({target:s,listeners:w}),t.remove({target:s,listeners:L})}function E(e){switch(O=e.data.state){case i.PAUSED:P.debug("remove stats listener"),t.remove({target:s,listeners:M});break;case i.PLAYING:break;case i.LOADING:h(),g&&(P.debug("hls: add stats listener"),t.add({target:s,listeners:M}))}}function l(e){g=r.mustUseHLS||e.data.config.playback.allowSafariHlsFallback&&r.canUseHLS}function p(e){b+=1,D+=e.data.byteLength}function T(e){g||(P.debug("wss: add stats listener"),t.add({target:s,listeners:M})),N=e.data.onStreamInfo.haveVideo}function m(e){N=e.data.onStreamInfo.haveVideo}function A(t){var n=t.data.buffered.length-1,r=t.data.played.length-1;if(R.currentTime=O===i.LOADING?0:t.data.currentTime,r>=0&&(R.playout.start=t.data.played.start(r),R.playout.end=t.data.played.end(r)),n>=0&&(!g||g&&(R.buffer.end!==t.data.buffered.end(n)||t.data.buffered.end(n)<R.currentTime))&&(R.buffer.update.current=t.data.buffered.end(n)-R.buffer.end,R.buffer.delay.before=R.buffer.end-R.currentTime,R.buffer.start=t.data.buffered.start(n),R.buffer.end=t.data.buffered.end(n),R.buffer.delay.current=R.buffer.end-R.currentTime,v.add(R.buffer.delay.current),S(v,R.buffer.delay),y.add(R.buffer.update.current),S(y,R.buffer.update)),e&&!g){var o=Math.floor(e.now()/1e3);U!==o&&(U=o,R.bitrate.current=8*D,I.add(R.bitrate.current),S(I,R.bitrate),N&&(R.framerate.current=b,C.add(R.framerate.current),S(C,R.framerate)),b=0,D=0)}_(t)}function _(e){s.emit(c.PLAY_STATS,{stats:R,buffered:e?e.data.buffered:null,played:e?e.data.played:null,currentTime:e?e.data.currentTime:0,playbackRate:e?e.data.playbackRate:0})}function S(e,t){t.avg=e.arithmetic,t.min=e.minimum,t.max=e.maximum}function h(){R={currentTime:0,playout:{start:0,end:0},buffer:{start:0,end:0,delay:{before:0,current:0,avg:0,min:0,max:0},update:{current:0,avg:0,min:0,max:0}},quality:{droppedVideoFrames:0,droppedVideoFramesCurrent:0,corruptedVideoFrames:0,corruptedVideoFramesCurrent:0,creationTime:0,totalVideoFrames:0},bitrate:{current:0,avg:0,min:0,max:0},framerate:{current:0,avg:0,min:0,max:0}},v=o.create(10),y=o.create(10),I=o.create(10),C=o.create(10),b=0,D=0,_(null)}var R,O,g,N,v,y,I,C,b,D,P=n.create("StatsCollector"),U=0,L=[{type:a.APPLICATION_STATE_CHANGE,listener:E},{type:a.CONFIG,listener:l}],w=[{type:a.STREAM_FRAGMENT,listener:p},{type:a.STREAM_INFO,listener:T},{type:a.STREAM_INFO_UPDATE,listener:m}],M=[{type:u.TIME_UPDATE,listener:A}];return d(),{destroy:f}}return{create:d}}.apply(t,r),!(void 0!==o&&(e.exports=o))},function(e,t,n){var r,o;r=[n(71)],o=function(e){function t(t){function n(){i()&&t.addListener(e.STREAM_FRAGMENT,o)}function r(){t.removeListener(e.STREAM_FRAGMENT,o)}function o(e){window.fragments||(window.fragments=[]),window.fragments.push(e.data)}function i(){return!!a("nanoDump")}function a(e){return document.cookie.indexOf(e+"=")!==-1?document.cookie.split(e+"=")[1].split(";")[0]:null}return n(),{destroy:r}}return{create:t}}.apply(t,r),!(void 0!==o&&(e.exports=o))},function(e,t,n){var r,o;r=[],o=function(){return{FORCE_NOT_SUPPORTED:'The forced tech "$tech$" is not supported by your browser.',SOURCE_NOT_SUPPORTED:"The players source configuration is malformed or missing, please check documentation for more information or contact us.",CLIENT_NOT_SUPPORTED:"This browser does not fully support HTML5 and H5Live.\t            Supported are: Chrome >=54 (Windows, MacOSX, Android), Firefox >=48 (Windows, MacOSX, Android), Microsoft Edge (Windows), Microsoft Internet Explorer 11 (at least Windows 8), Safari (MacOSX & at least iOS 10)."}}.apply(t,r),!(void 0!==o&&(e.exports=o))},function(e,t,n){var r,o;r=[],o=function(){function e(e,t,n){function r(){for(var n in t)t.hasOwnProperty(n)&&e.on(t[n],i)}function o(){for(var n in t)t.hasOwnProperty(n)&&e.off(t[n],i)}function i(e){n.emit(e.name,e)}return r(),{destroy:o}}return{create:e}}.apply(t,r),!(void 0!==o&&(e.exports=o))},function(e,t,n){var r,o;r=[],o=function(){function e(){}function t(e,t){return function(){e.apply(t,arguments)}}function n(e){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],u(e,this)}function r(e,t){for(;3===e._state;)e=e._value;return 0===e._state?void e._deferreds.push(t):(e._handled=!0,void n._immediateFn(function(){var n=1===e._state?t.onFulfilled:t.onRejected;if(null===n)return void(1===e._state?o:i)(t.promise,e._value);var r;try{r=n(e._value)}catch(e){return void i(t.promise,e)}o(t.promise,r)}))}function o(e,r){try{if(r===e)throw new TypeError("A promise cannot be resolved with itself.");if(r&&("object"==typeof r||"function"==typeof r)){var o=r.then;if(r instanceof n)return e._state=3,e._value=r,void a(e);if("function"==typeof o)return void u(t(o,r),e)}e._state=1,e._value=r,a(e)}catch(t){i(e,t)}}function i(e,t){e._state=2,e._value=t,a(e)}function a(e){2===e._state&&0===e._deferreds.length&&n._immediateFn(function(){e._handled||n._unhandledRejectionFn(e._value)});for(var t=0,o=e._deferreds.length;t<o;t++)r(e,e._deferreds[t]);e._deferreds=null}function s(e,t,n){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.promise=n}function u(e,t){var n=!1;try{e(function(e){n||(n=!0,o(t,e))},function(e){n||(n=!0,i(t,e))})}catch(e){if(n)return;n=!0,i(t,e)}}var c=setTimeout;return n.prototype.catch=function(e){return this.then(null,e)},n.prototype.then=function(t,n){var o=new this.constructor(e);return r(this,new s(t,n,o)),o},n.all=function(e){var t=Array.prototype.slice.call(e);return new n(function(e,n){function r(i,a){try{if(a&&("object"==typeof a||"function"==typeof a)){var s=a.then;if("function"==typeof s)return void s.call(a,function(e){r(i,e)},n)}t[i]=a,0===--o&&e(t)}catch(e){n(e)}}if(0===t.length)return e([]);for(var o=t.length,i=0;i<t.length;i++)r(i,t[i])})},n.resolve=function(e){return e&&"object"==typeof e&&e.constructor===n?e:new n(function(t){t(e)})},n.reject=function(e){return new n(function(t,n){n(e)})},n.race=function(e){return new n(function(t,n){for(var r=0,o=e.length;r<o;r++)e[r].then(t,n)})},n._immediateFn="function"==typeof window.setImmediate&&function(e){window.setImmediate(e)}||function(e){c(e,0)},n._unhandledRejectionFn=function(e){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",e)},n._setImmediateFn=function(e){n._immediateFn=e},n._setUnhandledRejectionFn=function(e){n._unhandledRejectionFn=e},void 0===window.Promise&&(window.Promise=n),window.Promise}.apply(t,r),!(void 0!==o&&(e.exports=o))}])});