@flowplayer/player
Version:
video player for the future
1 lines • 698 kB
JavaScript
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):((e="undefined"!=typeof globalThis?globalThis:e||self).flowplayer=e.flowplayer||{},e.flowplayer.dash=t())}(this,(function(){"use strict";function e(e){const t=function(){const e="undefined"!=typeof document&&"undefined"!=typeof window,t=e?navigator.userAgent:"",n=/iP(hone|od)/i.test(t)&&!/iPad/.test(t)&&!/IEMobile/i.test(t),r=/Android/.test(t)&&!/Firefox/.test(t),i=/^((?!chrome|android).)*safari/i.test(t),a=/chrome|crios/i.test(t)&&!/opr|opera|chromium|edg|ucbrowser|googlebot/i.test(t),o=/firefox|fxios/i.test(t)&&!/seamonkey/i.test(t),s=/edg/i.test(t),u=/opr|opera/i.test(t),l=/SamsungBrowser/.test(t),f=l&&/SMART-TV/.test(t);return{controls:!n,video:function(t){return e&&document.createElement("video").canPlayType(t)},lang:e&&window.navigator.language,android:r,iphone:n,safari:i,edge:s,opera:u,chrome:a,firefox:o,ios:e&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,samsung:l,samsung_tv:l&&f,touch:"ontouchstart"in window,tizen:"tizen"in window,webOS:"webos"in window}}();switch(e){case"com.widevine.alpha":return t.chrome||t.firefox||t.edge||t.opera;case"org.w3.clearkey":return t.chrome||t.firefox;case"com.microsoft.playready":return t.edge}}function t(e){const{pathname:t}=function(e){const t=document.createElement("a");return t.href=e,t}(e);return t.endsWith(".mpd")}var n="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{};var r="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function i(e){if(e.__esModule)return e;var t=Object.defineProperty({},"__esModule",{value:!0});return Object.keys(e).forEach((function(n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})})),t}function o(e){var t={exports:{}};return e(t,t.exports),t.exports}var u=o((function(e,t){!function(e){var t={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,128:174,129:176,130:189,131:191,132:8482,133:162,134:163,135:9834,136:224,137:32,138:232,139:226,140:234,141:238,142:244,143:251,144:193,145:201,146:211,147:218,148:220,149:252,150:8216,151:161,152:42,153:8217,154:9473,155:169,156:8480,157:8226,158:8220,159:8221,160:192,161:194,162:199,163:200,164:202,165:203,166:235,167:206,168:207,169:239,170:212,171:217,172:249,173:219,174:171,175:187,176:195,177:227,178:205,179:204,180:236,181:210,182:242,183:213,184:245,185:123,186:125,187:92,188:94,189:95,190:124,191:8764,192:196,193:228,194:214,195:246,196:223,197:165,198:164,199:9475,200:197,201:229,202:216,203:248,204:9487,205:9491,206:9495,207:9499},n=function(e){var n=e;return t.hasOwnProperty(e)&&(n=t[e]),String.fromCharCode(n)},r={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},i={17:2,18:4,21:6,22:8,23:10,19:13,20:15},a={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},o={25:2,26:4,29:6,30:8,31:10,27:13,28:15},s=["white","green","blue","cyan","red","yellow","magenta","black","transparent"],u={verboseFilter:{DATA:3,DEBUG:3,INFO:2,WARNING:2,TEXT:1,ERROR:0},time:null,verboseLevel:0,setTime:function(e){this.time=e},log:function(e,t){var n=this.verboseFilter[e];this.verboseLevel>=n&&console.log(this.time+" ["+e+"] "+t)}},l=function(e){for(var t=[],n=0;n<e.length;n++)t.push(e[n].toString(16));return t},f=function(e,t,n,r,i){this.foreground=e||"white",this.underline=t||!1,this.italics=n||!1,this.background=r||"black",this.flash=i||!1};f.prototype={reset:function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1},setStyles:function(e){for(var t=["foreground","underline","italics","background","flash"],n=0;n<t.length;n++){var r=t[n];e.hasOwnProperty(r)&&(this[r]=e[r])}},isDefault:function(){return"white"===this.foreground&&!this.underline&&!this.italics&&"black"===this.background&&!this.flash},equals:function(e){return this.foreground===e.foreground&&this.underline===e.underline&&this.italics===e.italics&&this.background===e.background&&this.flash===e.flash},copy:function(e){this.foreground=e.foreground,this.underline=e.underline,this.italics=e.italics,this.background=e.background,this.flash=e.flash},toString:function(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash}};var d=function(e,t,n,r,i,a){this.uchar=e||" ",this.penState=new f(t,n,r,i,a)};d.prototype={reset:function(){this.uchar=" ",this.penState.reset()},setChar:function(e,t){this.uchar=e,this.penState.copy(t)},setPenState:function(e){this.penState.copy(e)},equals:function(e){return this.uchar===e.uchar&&this.penState.equals(e.penState)},copy:function(e){this.uchar=e.uchar,this.penState.copy(e.penState)},isEmpty:function(){return" "===this.uchar&&this.penState.isDefault()}};var c=function(){this.chars=[];for(var e=0;e<32;e++)this.chars.push(new d);this.pos=0,this.currPenState=new f};c.prototype={equals:function(e){for(var t=!0,n=0;n<32;n++)if(!this.chars[n].equals(e.chars[n])){t=!1;break}return t},copy:function(e){for(var t=0;t<32;t++)this.chars[t].copy(e.chars[t])},isEmpty:function(){for(var e=!0,t=0;t<32;t++)if(!this.chars[t].isEmpty()){e=!1;break}return e},setCursor:function(e){this.pos!==e&&(this.pos=e),this.pos<0?(u.log("ERROR","Negative cursor position "+this.pos),this.pos=0):this.pos>32&&(u.log("ERROR","Too large cursor position "+this.pos),this.pos=32)},moveCursor:function(e){var t=this.pos+e;if(e>1)for(var n=this.pos+1;n<t+1;n++)this.chars[n].setPenState(this.currPenState);this.setCursor(t)},backSpace:function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)},insertChar:function(e){e>=144&&this.backSpace();var t=n(e);this.pos>=32?u.log("ERROR","Cannot insert "+e.toString(16)+" ("+t+") at position "+this.pos+". Skipping it!"):(this.chars[this.pos].setChar(t,this.currPenState),this.moveCursor(1))},clearFromPos:function(e){var t;for(t=e;t<32;t++)this.chars[t].reset()},clear:function(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()},clearToEndOfRow:function(){this.clearFromPos(this.pos)},getTextString:function(){for(var e=[],t=!0,n=0;n<32;n++){var r=this.chars[n].uchar;" "!==r&&(t=!1),e.push(r)}return t?"":e.join("")},setPenStyles:function(e){this.currPenState.setStyles(e),this.chars[this.pos].setPenState(this.currPenState)}};var h=function(){this.rows=[];for(var e=0;e<15;e++)this.rows.push(new c);this.currRow=14,this.nrRollUpRows=null,this.reset()};h.prototype={reset:function(){for(var e=0;e<15;e++)this.rows[e].clear();this.currRow=14},equals:function(e){for(var t=!0,n=0;n<15;n++)if(!this.rows[n].equals(e.rows[n])){t=!1;break}return t},copy:function(e){for(var t=0;t<15;t++)this.rows[t].copy(e.rows[t])},isEmpty:function(){for(var e=!0,t=0;t<15;t++)if(!this.rows[t].isEmpty()){e=!1;break}return e},backSpace:function(){this.rows[this.currRow].backSpace()},clearToEndOfRow:function(){this.rows[this.currRow].clearToEndOfRow()},insertChar:function(e){this.rows[this.currRow].insertChar(e)},setPen:function(e){this.rows[this.currRow].setPenStyles(e)},moveCursor:function(e){this.rows[this.currRow].moveCursor(e)},setCursor:function(e){u.log("INFO","setCursor: "+e),this.rows[this.currRow].setCursor(e)},setPAC:function(e){u.log("INFO","pacData = "+JSON.stringify(e));var t=e.row-1;this.nrRollUpRows&&t<this.nrRollUpRows-1&&(t=this.nrRollUpRows-1),this.currRow=t;var n=this.rows[this.currRow];if(null!==e.indent){var r=e.indent,i=Math.max(r-1,0);n.setCursor(e.indent),e.color=n.chars[i].penState.foreground}var a={foreground:e.color,underline:e.underline,italics:e.italics,background:"black",flash:!1};this.setPen(a)},setBkgData:function(e){u.log("INFO","bkgData = "+JSON.stringify(e)),this.backSpace(),this.setPen(e),this.insertChar(32)},setRollUpRows:function(e){this.nrRollUpRows=e},rollUp:function(){if(null!==this.nrRollUpRows){u.log("TEXT",this.getDisplayText());var e=this.currRow+1-this.nrRollUpRows,t=this.rows.splice(e,1)[0];t.clear(),this.rows.splice(this.currRow,0,t),u.log("INFO","Rolling up")}else u.log("DEBUG","roll_up but nrRollUpRows not set yet")},getDisplayText:function(e){e=e||!1;for(var t=[],n="",r=-1,i=0;i<15;i++){var a=this.rows[i].getTextString();a&&(r=i+1,e?t.push("Row "+r+': "'+a+'"'):t.push(a.trim()))}return t.length>0&&(n=e?"["+t.join(" | ")+"]":t.join("\n")),n},getTextAndFormat:function(){return this.rows}};var p=function(e,t){this.chNr=e,this.outputFilter=t,this.mode=null,this.verbose=0,this.displayedMemory=new h,this.nonDisplayedMemory=new h,this.lastOutputScreen=new h,this.currRollUpRow=this.displayedMemory.rows[14],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null};p.prototype={modes:["MODE_ROLL-UP","MODE_POP-ON","MODE_PAINT-ON","MODE_TEXT"],reset:function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.currRollUpRow=this.displayedMemory.rows[14],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.lastCueEndTime=null},getHandler:function(){return this.outputFilter},setHandler:function(e){this.outputFilter=e},setPAC:function(e){this.writeScreen.setPAC(e)},setBkgData:function(e){this.writeScreen.setBkgData(e)},setMode:function(e){e!==this.mode&&(this.mode=e,u.log("INFO","MODE="+e),"MODE_POP-ON"==this.mode?this.writeScreen=this.nonDisplayedMemory:(this.writeScreen=this.displayedMemory,this.writeScreen.reset()),"MODE_ROLL-UP"!==this.mode&&(this.displayedMemory.nrRollUpRows=null,this.nonDisplayedMemory.nrRollUpRows=null),this.mode=e)},insertChars:function(e){for(var t=0;t<e.length;t++)this.writeScreen.insertChar(e[t]);var n=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";u.log("INFO",n+": "+this.writeScreen.getDisplayText(!0)),"MODE_PAINT-ON"!==this.mode&&"MODE_ROLL-UP"!==this.mode||(u.log("TEXT","DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())},cc_RCL:function(){u.log("INFO","RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")},cc_BS:function(){u.log("INFO","BS - BackSpace"),"MODE_TEXT"!==this.mode&&(this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate())},cc_AOF:function(){},cc_AON:function(){},cc_DER:function(){u.log("INFO","DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()},cc_RU:function(e){u.log("INFO","RU("+e+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(e)},cc_FON:function(){u.log("INFO","FON - Flash On"),this.writeScreen.setPen({flash:!0})},cc_RDC:function(){u.log("INFO","RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")},cc_TR:function(){u.log("INFO","TR"),this.setMode("MODE_TEXT")},cc_RTD:function(){u.log("INFO","RTD"),this.setMode("MODE_TEXT")},cc_EDM:function(){u.log("INFO","EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate()},cc_CR:function(){u.log("CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate()},cc_ENM:function(){u.log("INFO","ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()},cc_EOC:function(){if(u.log("INFO","EOC - End Of Caption"),"MODE_POP-ON"===this.mode){var e=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=e,this.writeScreen=this.nonDisplayedMemory,u.log("TEXT","DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate()},cc_TO:function(e){u.log("INFO","TO("+e+") - Tab Offset"),this.writeScreen.moveCursor(e)},cc_MIDROW:function(e){var t={flash:!1};if(t.underline=e%2==1,t.italics=e>=46,t.italics)t.foreground="white";else{var n=Math.floor(e/2)-16;t.foreground=["white","green","blue","cyan","red","yellow","magenta"][n]}u.log("INFO","MIDROW: "+JSON.stringify(t)),this.writeScreen.setPen(t)},outputDataUpdate:function(){var e=u.time;null!==e&&this.outputFilter&&(this.outputFilter.updateData&&this.outputFilter.updateData(e,this.displayedMemory),null!==this.cueStartTime||this.displayedMemory.isEmpty()?this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,e,this.lastOutputScreen),this.cueStartTime=this.displayedMemory.isEmpty()?null:e):this.cueStartTime=e,this.lastOutputScreen.copy(this.displayedMemory))},cueSplitAtTime:function(e){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,e,this.displayedMemory),this.cueStartTime=e))}};var g=function(e,t,n){this.field=e||1,this.outputs=[t,n],this.channels=[new p(1,t),new p(2,n)],this.currChNr=-1,this.lastCmdA=null,this.lastCmdB=null,this.bufferedData=[],this.startTime=null,this.lastTime=null,this.dataCounters={padding:0,char:0,cmd:0,other:0}};g.prototype={getHandler:function(e){return this.channels[e].getHandler()},setHandler:function(e,t){this.channels[e].setHandler(t)},addData:function(e,t){var n,r,i,a=!1;this.lastTime=e,u.setTime(e);for(var o=0;o<t.length;o+=2)if(r=127&t[o],i=127&t[o+1],r>=16&&r<=31&&r===this.lastCmdA&&i===this.lastCmdB)this.lastCmdA=null,this.lastCmdB=null,u.log("DEBUG","Repeated command ("+l([r,i])+") is dropped");else if(0!==r||0!==i){if(u.log("DATA","["+l([t[o],t[o+1]])+"] -> ("+l([r,i])+")"),(n=this.parseCmd(r,i))||(n=this.parseMidrow(r,i)),n||(n=this.parsePAC(r,i)),n||(n=this.parseBackgroundAttributes(r,i)),!n)if(a=this.parseChars(r,i))if(this.currChNr&&this.currChNr>=0)this.channels[this.currChNr-1].insertChars(a);else u.log("WARNING","No channel found yet. TEXT-MODE?");n?this.dataCounters.cmd+=2:a?this.dataCounters.char+=2:(this.dataCounters.other+=2,u.log("WARNING","Couldn't parse cleaned data "+l([r,i])+" orig: "+l([t[o],t[o+1]])))}else this.dataCounters.padding+=2},parseCmd:function(e,t){var n=null;if(!((20===e||21===e||28===e||29===e)&&32<=t&&t<=47)&&!((23===e||31===e)&&33<=t&&t<=35))return!1;n=20===e||21===e||23===e?1:2;var r=this.channels[n-1];return 20===e||21===e||28===e||29===e?32===t?r.cc_RCL():33===t?r.cc_BS():34===t?r.cc_AOF():35===t?r.cc_AON():36===t?r.cc_DER():37===t?r.cc_RU(2):38===t?r.cc_RU(3):39===t?r.cc_RU(4):40===t?r.cc_FON():41===t?r.cc_RDC():42===t?r.cc_TR():43===t?r.cc_RTD():44===t?r.cc_EDM():45===t?r.cc_CR():46===t?r.cc_ENM():47===t&&r.cc_EOC():r.cc_TO(t-32),this.lastCmdA=e,this.lastCmdB=t,this.currChNr=n,!0},parseMidrow:function(e,t){var n=null;if((17===e||25===e)&&32<=t&&t<=47){if((n=17===e?1:2)!==this.currChNr)return u.log("ERROR","Mismatch channel in midrow parsing"),!1;var r=this.channels[n-1];return r.insertChars([32]),r.cc_MIDROW(t),u.log("DEBUG","MIDROW ("+l([e,t])+")"),this.lastCmdA=e,this.lastCmdB=t,!0}return!1},parsePAC:function(e,t){var n,s=null;if(!((17<=e&&e<=23||25<=e&&e<=31)&&64<=t&&t<=127)&&!((16===e||24===e)&&64<=t&&t<=95))return!1;n=e<=23?1:2,s=64<=t&&t<=95?1===n?r[e]:a[e]:1===n?i[e]:o[e];var u=this.interpretPAC(s,t);return this.channels[n-1].setPAC(u),this.lastCmdA=e,this.lastCmdB=t,this.currChNr=n,!0},interpretPAC:function(e,t){var n=t,r={color:null,italics:!1,indent:null,underline:!1,row:e};return n=t>95?t-96:t-64,r.underline=1==(1&n),n<=13?r.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(n/2)]:n<=15?(r.italics=!0,r.color="white"):r.indent=4*Math.floor((n-16)/2),r},parseChars:function(e,t){var r=null,i=null,a=null;if(e>=25?(r=2,a=e-8):(r=1,a=e),17<=a&&a<=19){var o=t;o=17===a?t+80:18===a?t+112:t+144,u.log("INFO","Special char '"+n(o)+"' in channel "+r),i=[o],this.lastCmdA=e,this.lastCmdB=t}else 32<=e&&e<=127&&(i=0===t?[e]:[e,t],this.lastCmdA=null,this.lastCmdB=null);if(i){var s=l(i);u.log("DEBUG","Char codes = "+s.join(","))}return i},parseBackgroundAttributes:function(e,t){var n,r,i;return((16===e||24===e)&&32<=t&&t<=47||(23===e||31===e)&&45<=t&&t<=47)&&(n={},16===e||24===e?(r=Math.floor((t-32)/2),n.background=s[r],t%2==1&&(n.background=n.background+"_semi")):45===t?n.background="transparent":(n.foreground="black",47===t&&(n.underline=!0)),i=e<24?1:2,this.channels[i-1].setBkgData(n),this.lastCmdA=e,this.lastCmdB=t,!0)},reset:function(){for(var e=0;e<this.channels.length;e++)this.channels[e]&&this.channels[e].reset();this.lastCmdA=null,this.lastCmdB=null},cueSplitAtTime:function(e){for(var t=0;t<this.channels.length;t++)this.channels[t]&&this.channels[t].cueSplitAtTime(e)}};e.logger=u,e.PenState=f,e.CaptionScreen=h,e.Cea608Parser=g,e.findCea608Nalus=function(e,t,n){for(var r=0,i=t,a=[],o=function(e,t,n,r){if(4!==e||t<8)return null;var i=n.getUint8(r),a=n.getUint16(r+1),o=n.getUint32(r+3),s=n.getUint8(r+7);return 181==i&&49==a&&1195456820==o&&3==s};i<t+n;){if(r=e.getUint32(i),6===(31&e.getUint8(i+4)))for(var s=i+5,u=-1;s<i+4+r-1;){u=0;for(var l=255;255===l;)u+=l=e.getUint8(s),s++;var f=0;for(l=255;255===l;)f+=l=e.getUint8(s),s++;o(u,f,e,s)&&a.push([s,f]),s+=f}i+=r+4}return a},e.extractCea608DataFromRange=function(e,t){var n=t[0],r=[[],[]];n+=8;var i=31&e.getUint8(n);n+=2;for(var a=0;a<i;a++){var o=e.getUint8(n),s=4&o,u=3&o;n++;var l=e.getUint8(n);n++;var f=e.getUint8(n);n++,s&&(127&l)+(127&f)!=0&&(0===u?(r[0].push(l),r[0].push(f)):1===u&&(r[1].push(l),r[1].push(f)))}return r}}(t)})),l=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var f=new(function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.init()}return l(e,[{key:"init",value:function(){this.STREAM="stream",this.VIDEO="video",this.AUDIO="audio",this.TEXT="text",this.FRAGMENTED_TEXT="fragmentedText",this.EMBEDDED_TEXT="embeddedText",this.MUXED="muxed",this.IMAGE="image",this.STPP="stpp",this.TTML="ttml",this.VTT="vtt",this.WVTT="wvtt",this.ABR_STRATEGY_DYNAMIC="abrDynamic",this.ABR_STRATEGY_BOLA="abrBola",this.ABR_STRATEGY_L2A="abrL2A",this.ABR_STRATEGY_LoLP="abrLoLP",this.ABR_STRATEGY_THROUGHPUT="abrThroughput",this.ABR_FETCH_THROUGHPUT_CALCULATION_DOWNLOADED_DATA="abrFetchThroughputCalculationDownloadedData",this.ABR_FETCH_THROUGHPUT_CALCULATION_MOOF_PARSING="abrFetchThroughputCalculationMoofParsing",this.LIVE_CATCHUP_MODE_DEFAULT="liveCatchupModeDefault",this.LIVE_CATCHUP_MODE_LOLP="liveCatchupModeLoLP",this.MOVING_AVERAGE_SLIDING_WINDOW="slidingWindow",this.MOVING_AVERAGE_EWMA="ewma",this.BAD_ARGUMENT_ERROR="Invalid Arguments",this.MISSING_CONFIG_ERROR="Missing config parameter(s)",this.TRACK_SWITCH_MODE_ALWAYS_REPLACE="alwaysReplace",this.TRACK_SWITCH_MODE_NEVER_REPLACE="neverReplace",this.TRACK_SELECTION_MODE_FIRST_TRACK="firstTrack",this.TRACK_SELECTION_MODE_HIGHEST_BITRATE="highestBitrate",this.TRACK_SELECTION_MODE_HIGHEST_EFFICIENCY="highestEfficiency",this.TRACK_SELECTION_MODE_WIDEST_RANGE="widestRange",this.CMCD_MODE_QUERY="query",this.CMCD_MODE_HEADER="header",this.LOCATION="Location",this.INITIALIZE="initialize",this.TEXT_SHOWING="showing",this.TEXT_HIDDEN="hidden",this.CC1="CC1",this.CC3="CC3",this.UTF8="utf-8",this.SCHEME_ID_URI="schemeIdUri",this.START_TIME="starttime",this.SERVICE_DESCRIPTION_LL_SCHEME="urn:dvb:dash:lowlatency:scope:2019",this.SUPPLEMENTAL_PROPERTY_LL_SCHEME="urn:dvb:dash:lowlatency:critical:2019",this.XML="XML",this.ARRAY_BUFFER="ArrayBuffer",this.DVB_REPORTING_URL="dvb:reportingUrl",this.DVB_PROBABILITY="dvb:probability"}}]),e}()),d=Object.defineProperty({default:f},"__esModule",{value:!0}),c=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var h=new(function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.init()}return c(e,[{key:"init",value:function(){this.BASE_URL="BaseURL",this.SEGMENT_BASE="SegmentBase",this.SEGMENT_TEMPLATE="SegmentTemplate",this.SEGMENT_LIST="SegmentList",this.SEGMENT_URL="SegmentURL",this.SEGMENT_TIMELINE="SegmentTimeline",this.SEGMENT_PROFILES="segmentProfiles",this.ADAPTATION_SET="AdaptationSet",this.REPRESENTATION="Representation",this.REPRESENTATION_INDEX="RepresentationIndex",this.SUB_REPRESENTATION="SubRepresentation",this.INITIALIZATION="Initialization",this.INITIALIZATION_MINUS="initialization",this.MPD="MPD",this.PERIOD="Period",this.ASSET_IDENTIFIER="AssetIdentifier",this.EVENT_STREAM="EventStream",this.ID="id",this.PROFILES="profiles",this.SERVICE_LOCATION="serviceLocation",this.RANGE="range",this.INDEX="index",this.MEDIA="media",this.BYTE_RANGE="byteRange",this.INDEX_RANGE="indexRange",this.MEDIA_RANGE="mediaRange",this.VALUE="value",this.CONTENT_TYPE="contentType",this.MIME_TYPE="mimeType",this.BITSTREAM_SWITCHING="BitstreamSwitching",this.BITSTREAM_SWITCHING_MINUS="bitstreamSwitching",this.CODECS="codecs",this.DEPENDENCY_ID="dependencyId",this.MEDIA_STREAM_STRUCTURE_ID="mediaStreamStructureId",this.METRICS="Metrics",this.METRICS_MINUS="metrics",this.REPORTING="Reporting",this.WIDTH="width",this.HEIGHT="height",this.SAR="sar",this.FRAMERATE="frameRate",this.AUDIO_SAMPLING_RATE="audioSamplingRate",this.MAXIMUM_SAP_PERIOD="maximumSAPPeriod",this.START_WITH_SAP="startWithSAP",this.MAX_PLAYOUT_RATE="maxPlayoutRate",this.CODING_DEPENDENCY="codingDependency",this.SCAN_TYPE="scanType",this.FRAME_PACKING="FramePacking",this.AUDIO_CHANNEL_CONFIGURATION="AudioChannelConfiguration",this.CONTENT_PROTECTION="ContentProtection",this.ESSENTIAL_PROPERTY="EssentialProperty",this.SUPPLEMENTAL_PROPERTY="SupplementalProperty",this.INBAND_EVENT_STREAM="InbandEventStream",this.ACCESSIBILITY="Accessibility",this.ROLE="Role",this.RATING="Rating",this.CONTENT_COMPONENT="ContentComponent",this.SUBSET="Subset",this.LANG="lang",this.VIEWPOINT="Viewpoint",this.ROLE_ASARRAY="Role_asArray",this.ACCESSIBILITY_ASARRAY="Accessibility_asArray",this.AUDIOCHANNELCONFIGURATION_ASARRAY="AudioChannelConfiguration_asArray",this.CONTENTPROTECTION_ASARRAY="ContentProtection_asArray",this.MAIN="main",this.DYNAMIC="dynamic",this.STATIC="static",this.MEDIA_PRESENTATION_DURATION="mediaPresentationDuration",this.MINIMUM_UPDATE_PERIOD="minimumUpdatePeriod",this.CODEC_PRIVATE_DATA="codecPrivateData",this.BANDWITH="bandwidth",this.SOURCE_URL="sourceURL",this.TIMESCALE="timescale",this.DURATION="duration",this.START_NUMBER="startNumber",this.PRESENTATION_TIME_OFFSET="presentationTimeOffset",this.AVAILABILITY_START_TIME="availabilityStartTime",this.AVAILABILITY_END_TIME="availabilityEndTime",this.TIMESHIFT_BUFFER_DEPTH="timeShiftBufferDepth",this.MAX_SEGMENT_DURATION="maxSegmentDuration",this.PRESENTATION_TIME="presentationTime",this.MIN_BUFFER_TIME="minBufferTime",this.MAX_SUBSEGMENT_DURATION="maxSubsegmentDuration",this.START="start",this.AVAILABILITY_TIME_OFFSET="availabilityTimeOffset",this.AVAILABILITY_TIME_COMPLETE="availabilityTimeComplete",this.CENC_DEFAULT_KID="cenc:default_KID",this.DVB_PRIORITY="dvb:priority",this.DVB_WEIGHT="dvb:weight",this.SUGGESTED_PRESENTATION_DELAY="suggestedPresentationDelay",this.SERVICE_DESCRIPTION="ServiceDescription",this.SERVICE_DESCRIPTION_SCOPE="Scope",this.SERVICE_DESCRIPTION_LATENCY="Latency",this.SERVICE_DESCRIPTION_PLAYBACK_RATE="PlaybackRate",this.PATCH_LOCATION="PatchLocation",this.PUBLISH_TIME="publishTime",this.ORIGINAL_PUBLISH_TIME="originalPublishTime",this.ORIGINAL_MPD_ID="mpdId"}}]),e}()),p=Object.defineProperty({default:h},"__esModule",{value:!0}),g=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var m=new(function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.init()}return g(e,[{key:"init",value:function(){this.TCP_CONNECTION="TcpList",this.HTTP_REQUEST="HttpList",this.TRACK_SWITCH="RepSwitchList",this.BUFFER_LEVEL="BufferLevel",this.BUFFER_LOADED="bufferLoaded",this.ABANDON_LOAD="abandonload",this.ALLOW_LOAD="allowload",this.BUFFER_EMPTY="bufferStalled",this.BUFFER_STATE="BufferState",this.DVR_INFO="DVRInfo",this.DROPPED_FRAMES="DroppedFrames",this.SCHEDULING_INFO="SchedulingInfo",this.REQUESTS_QUEUE="RequestsQueue",this.MANIFEST_UPDATE="ManifestUpdate",this.MANIFEST_UPDATE_STREAM_INFO="ManifestUpdatePeriodInfo",this.MANIFEST_UPDATE_TRACK_INFO="ManifestUpdateRepresentationInfo",this.PLAY_LIST="PlayList",this.DVB_ERRORS="DVBErrors"}}]),e}()),_=Object.defineProperty({default:m},"__esModule",{value:!0}),E=function(){var e=void 0,t=[],n={},r={};function i(e,n){for(var r in t){var i=t[r];if(i.context===e&&i.name===n)return i.instance}return null}function a(e,t){return t[e]}function o(e,t,n){e in n&&(n[e]=t)}function s(t,n,r){var i=void 0,a=t.__dashjs_factory_name,o=n[a];if(o){var s=o.instance;if(!o.override)return s.apply({context:n,factory:e},r);for(var u in i=t.apply({context:n},r),s=s.apply({context:n,factory:e,parent:i},r))i.hasOwnProperty(u)&&(i[u]=s[u])}else i=t.apply({context:n},r);return i.getClassName=function(){return a},i}return e={extend:function(e,t,n,r){!r[e]&&t&&(r[e]={instance:t,override:n})},getSingletonInstance:i,setSingletonInstance:function(e,n,r){for(var i in t){var a=t[i];if(a.context===e&&a.name===n)return void(t[i].instance=r)}t.push({name:n,context:e,instance:r})},deleteSingletonInstances:function(e){t=t.filter((function(t){return t.context!==e}))},getSingletonFactory:function(e){var r=a(e.__dashjs_factory_name,n);return r||(r=function(n){var r=void 0;return void 0===n&&(n={}),{getInstance:function(){return r||(r=i(n,e.__dashjs_factory_name)),r||(r=s(e,n,arguments),t.push({name:e.__dashjs_factory_name,context:n,instance:r})),r}}},n[e.__dashjs_factory_name]=r),r},getSingletonFactoryByName:function(e){return a(e,n)},updateSingletonFactory:function(e,t){o(e,t,n)},getClassFactory:function(e){var t=a(e.__dashjs_factory_name,r);return t||(t=function(t){return void 0===t&&(t={}),{create:function(){return s(e,t,arguments)}}},r[e.__dashjs_factory_name]=t),t},getClassFactoryByName:function(e){return a(e,r)},updateClassFactory:function(e,t){o(e,t,r)}}}(),y=Object.defineProperty({default:E},"__esModule",{value:!0}),v=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var T,A=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return v(e,[{key:"extend",value:function(e,t){if(e){var n=!!t&&t.override,r=!!t&&t.publicOnly;for(var i in e)!e.hasOwnProperty(i)||this[i]&&!n||r&&-1===e[i].indexOf("public_")||(this[i]=e[i])}}}]),e}(),S=Object.defineProperty({default:A},"__esModule",{value:!0});var b=new(function(e){function t(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var e=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.AST_IN_FUTURE="astInFuture",e.BUFFER_EMPTY="bufferStalled",e.BUFFER_LOADED="bufferLoaded",e.BUFFER_LEVEL_STATE_CHANGED="bufferStateChanged",e.DYNAMIC_TO_STATIC="dynamicToStatic",e.ERROR="error",e.FRAGMENT_LOADING_COMPLETED="fragmentLoadingCompleted",e.FRAGMENT_LOADING_PROGRESS="fragmentLoadingProgress",e.FRAGMENT_LOADING_STARTED="fragmentLoadingStarted",e.FRAGMENT_LOADING_ABANDONED="fragmentLoadingAbandoned",e.LOG="log",e.MANIFEST_LOADED="manifestLoaded",e.METRICS_CHANGED="metricsChanged",e.METRIC_CHANGED="metricChanged",e.METRIC_ADDED="metricAdded",e.METRIC_UPDATED="metricUpdated",e.PERIOD_SWITCH_COMPLETED="periodSwitchCompleted",e.PERIOD_SWITCH_STARTED="periodSwitchStarted",e.QUALITY_CHANGE_REQUESTED="qualityChangeRequested",e.QUALITY_CHANGE_RENDERED="qualityChangeRendered",e.TRACK_CHANGE_RENDERED="trackChangeRendered",e.SOURCE_INITIALIZED="sourceInitialized",e.STREAM_INITIALIZING="streamInitializing",e.STREAM_UPDATED="streamUpdated",e.STREAM_INITIALIZED="streamInitialized",e.STREAM_TEARDOWN_COMPLETE="streamTeardownComplete",e.TEXT_TRACKS_ADDED="allTextTracksAdded",e.TEXT_TRACK_ADDED="textTrackAdded",e.TTML_PARSED="ttmlParsed",e.TTML_TO_PARSE="ttmlToParse",e.CAPTION_RENDERED="captionRendered",e.CAPTION_CONTAINER_RESIZE="captionContainerResize",e.CAN_PLAY="canPlay",e.PLAYBACK_ENDED="playbackEnded",e.PLAYBACK_ERROR="playbackError",e.PLAYBACK_NOT_ALLOWED="playbackNotAllowed",e.PLAYBACK_METADATA_LOADED="playbackMetaDataLoaded",e.PLAYBACK_PAUSED="playbackPaused",e.PLAYBACK_PLAYING="playbackPlaying",e.PLAYBACK_PROGRESS="playbackProgress",e.PLAYBACK_RATE_CHANGED="playbackRateChanged",e.PLAYBACK_SEEKED="playbackSeeked",e.PLAYBACK_SEEKING="playbackSeeking",e.PLAYBACK_SEEK_ASKED="playbackSeekAsked",e.PLAYBACK_STALLED="playbackStalled",e.PLAYBACK_STARTED="playbackStarted",e.PLAYBACK_TIME_UPDATED="playbackTimeUpdated",e.PLAYBACK_WAITING="playbackWaiting",e.MANIFEST_VALIDITY_CHANGED="manifestValidityChanged",e.GAP_CAUSED_SEEK_TO_PERIOD_END="gapCausedSeekToPeriodEnd",e.GAP_CAUSED_INTERNAL_SEEK="gapCausedInternalSeek",e.EVENT_MODE_ON_START="eventModeOnStart",e.EVENT_MODE_ON_RECEIVE="eventModeOnReceive",e.CONFORMANCE_VIOLATION="conformanceViolation",e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t}(((T=S)&&T.__esModule?T:{default:T}).default)),I=Object.defineProperty({default:b},"__esModule",{value:!0}),R=N(y),w=N(I);function N(e){return e&&e.__esModule?e:{default:e}}function M(){var e={};function t(t,n,r){var i=-1;return e[t]?(e[t].some((function(e,t){if(e&&e.callback===n&&(!r||r===e.scope))return i=t,!0})),i):i}return{on:function(n,r,i){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(!n)throw new Error("event type cannot be null or undefined");if(!r||"function"!=typeof r)throw new Error("listener must be a function: "+r);var o=a.priority||0;if(!(t(n,r,i)>=0)){e[n]=e[n]||[];var s={callback:r,scope:i,priority:o};i&&i.getStreamId&&(s.streamId=i.getStreamId()),i&&i.getType&&(s.mediaType=i.getType()),a&&a.mode&&(s.mode=a.mode);var u=e[n].some((function(t,r){if(t&&o>t.priority)return e[n].splice(r,0,s),!0}));u||e[n].push(s)}},off:function(n,r,i){if(n&&r&&e[n]){var a=t(n,r,i);a<0||(e[n][a]=null)}},trigger:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(t&&e[t]){if((n=n||{}).hasOwnProperty("type"))throw new Error("'type' is a reserved word for event dispatching");n.type=t,r.streamId&&(n.streamId=r.streamId),r.mediaType&&(n.mediaType=r.mediaType),e[t].filter((function(e){return!!e&&((!r.streamId||!e.streamId||e.streamId===r.streamId)&&((!r.mediaType||!e.mediaType||e.mediaType===r.mediaType)&&!(r.mode&&e.mode&&e.mode!==r.mode||!e.mode&&r.mode&&r.mode===w.default.EVENT_MODE_ON_RECEIVE)))})).forEach((function(e){return e&&e.callback.call(e.scope,n)}))}},reset:function(){e={}}}}M.__dashjs_factory_name="EventBus";var C=R.default.getSingletonFactory(M);C.EVENT_PRIORITY_LOW=0,C.EVENT_PRIORITY_HIGH=5e3,R.default.updateSingletonFactory(M.__dashjs_factory_name,C);var D=C,O=Object.defineProperty({default:D},"__esModule",{value:!0});var P=function(e){function t(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var e=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.ATTEMPT_BACKGROUND_SYNC="attemptBackgroundSync",e.BUFFERING_COMPLETED="bufferingCompleted",e.BUFFER_CLEARED="bufferCleared",e.BUFFER_LEVEL_UPDATED="bufferLevelUpdated",e.BYTES_APPENDED="bytesAppended",e.BYTES_APPENDED_END_FRAGMENT="bytesAppendedEndFragment",e.CHECK_FOR_EXISTENCE_COMPLETED="checkForExistenceCompleted",e.CURRENT_TRACK_CHANGED="currentTrackChanged",e.DATA_UPDATE_COMPLETED="dataUpdateCompleted",e.DATA_UPDATE_STARTED="dataUpdateStarted",e.INBAND_EVENTS="inbandEvents",e.INITIALIZATION_LOADED="initializationLoaded",e.INIT_FRAGMENT_LOADED="initFragmentLoaded",e.INIT_FRAGMENT_NEEDED="initFragmentNeeded",e.INTERNAL_MANIFEST_LOADED="internalManifestLoaded",e.ORIGINAL_MANIFEST_LOADED="originalManifestLoaded",e.LIVE_EDGE_SEARCH_COMPLETED="liveEdgeSearchCompleted",e.LOADING_COMPLETED="loadingCompleted",e.LOADING_PROGRESS="loadingProgress",e.LOADING_DATA_PROGRESS="loadingDataProgress",e.LOADING_ABANDONED="loadingAborted",e.MANIFEST_UPDATED="manifestUpdated",e.MEDIA_FRAGMENT_LOADED="mediaFragmentLoaded",e.MEDIA_FRAGMENT_NEEDED="mediaFragmentNeeded",e.QUOTA_EXCEEDED="quotaExceeded",e.REPRESENTATION_UPDATE_STARTED="representationUpdateStarted",e.REPRESENTATION_UPDATE_COMPLETED="representationUpdateCompleted",e.SEGMENTS_LOADED="segmentsLoaded",e.SERVICE_LOCATION_BLACKLIST_ADD="serviceLocationBlacklistAdd",e.SERVICE_LOCATION_BLACKLIST_CHANGED="serviceLocationBlacklistChanged",e.SOURCEBUFFER_REMOVE_COMPLETED="sourceBufferRemoveCompleted",e.STREAMS_COMPOSED="streamsComposed",e.STREAM_BUFFERING_COMPLETED="streamBufferingCompleted",e.STREAM_COMPLETED="streamCompleted",e.TEXT_TRACKS_QUEUE_INITIALIZED="textTracksQueueInitialized",e.TIME_SYNCHRONIZATION_COMPLETED="timeSynchronizationComplete",e.UPDATE_TIME_SYNC_OFFSET="updateTimeSyncOffset",e.URL_RESOLUTION_FAILED="urlResolutionFailed",e.VIDEO_CHUNK_RECEIVED="videoChunkReceived",e.WALLCLOCK_TIME_UPDATED="wallclockTimeUpdated",e.XLINK_ELEMENT_LOADED="xlinkElementLoaded",e.XLINK_READY="xlinkReady",e.SEGMENTBASE_INIT_REQUEST_NEEDED="segmentBaseInitRequestNeeded",e.SEGMENTBASE_SEGMENTSLIST_REQUEST_NEEDED="segmentBaseSegmentsListRequestNeeded",e.SEEK_TARGET="seekTarget",e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t}(function(e){return e&&e.__esModule?e:{default:e}}(S).default);function L(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function F(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var x=new(function(e){function t(){return L(this,t),F(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t}(function(e){return e&&e.__esModule?e:{default:e}}(Object.defineProperty({default:P},"__esModule",{value:!0})).default)),U=Object.defineProperty({default:x},"__esModule",{value:!0}),k=j(O),B=j(U),G=j(y);function j(e){return e&&e.__esModule?e:{default:e}}var Y=1,q=2,H=3,K=4,V=5;function z(e){e=e||{};var t,n=this.context,r=(0,k.default)(n).getInstance(),i=e.settings,a=[],o=void 0,s=void 0,u=void 0;function l(e){return e&&e.bind?e.bind(window.console):window.console.log.bind(window.console)}function f(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];g.apply(void 0,[Y,this].concat(t))}function d(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];g.apply(void 0,[q,this].concat(t))}function c(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];g.apply(void 0,[H,this].concat(t))}function h(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];g.apply(void 0,[K,this].concat(t))}function p(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];g.apply(void 0,[V,this].concat(t))}function g(e,t){var n="",l=null;o&&(l=(new Date).getTime(),n+="["+(l-u)+"]"),s&&t&&t.getClassName&&(n+="["+t.getClassName()+"]",t.getType&&(n+="["+t.getType()+"]")),n.length>0&&(n+=" ");for(var f=arguments.length,d=Array(f>2?f-2:0),c=2;c<f;c++)d[c-2]=arguments[c];Array.apply(null,d).forEach((function(e){n+=e+" "})),a[e]&&i.get().debug.logLevel>=e&&a[e](n),i&&i.get().debug.dispatchEvent&&r.trigger(B.default.LOG,{message:n,level:e})}return t={getLogger:function(e){return{fatal:f.bind(e),error:d.bind(e),warn:c.bind(e),info:h.bind(e),debug:p.bind(e)}},setLogTimestampVisible:function(e){o=e},setCalleeNameVisible:function(e){s=e}},o=!0,s=!0,u=(new Date).getTime(),"undefined"!=typeof window&&window.console&&(a[Y]=l(window.console.error),a[q]=l(window.console.error),a[H]=l(window.console.warn),a[K]=l(window.console.info),a[V]=l(window.console.debug)),t}z.__dashjs_factory_name="Debug";var W=G.default.getSingletonFactory(z);W.LOG_LEVEL_NONE=0,W.LOG_LEVEL_FATAL=Y,W.LOG_LEVEL_ERROR=q,W.LOG_LEVEL_WARNING=H,W.LOG_LEVEL_INFO=K,W.LOG_LEVEL_DEBUG=V,G.default.updateSingletonFactory(z.__dashjs_factory_name,W);var X=W,Q=Object.defineProperty({default:X},"__esModule",{value:!0}),$=re(d),Z=re(_),J=re(O),ee=re(U),te=re(y),ne=re(Q);function re(e){return e&&e.__esModule?e:{default:e}}function ie(){var e=this.context,t=(0,J.default)(e).getInstance(),n=void 0,r=void 0,i=void 0,a=void 0,o=void 0,s=void 0,u=void 0,l=void 0,f=void 0,d=void 0,c=void 0,h=void 0,p=void 0,g=void 0,m=void 0,_=void 0,E=void 0,y=void 0,v=void 0,T=void 0,A=void 0,S=void 0,b=void 0,I=void 0;function R(e){if(!l||!isNaN(f)){var n=f;if(isNaN(n))if(p){n=e.liveStartTime;var i=a.getCurrentDVRInfo(),o=i?i.range:null;if(o){var u=j(!0);isNaN(u)||(r.info("Start time from URI parameters: "+u),n=Math.max(Math.min(n,u),o.start))}}else{n=h.start;var d=j(!1);!isNaN(d)&&d<n+h.duration&&(r.info("Start time from URI parameters: "+d),n=Math.max(n,d))}isNaN(n)||n===s.getTime()||(t.trigger(ee.default.PLAYBACK_SEEKING,{seekTime:n}),P(n,!1,!0))}}function w(){return parseFloat((N()-L()).toFixed(5))}function N(){return h.start+h.duration}function M(){h&&s&&s.getElement()?s.play():m=!0}function C(){return h&&s?s.isPaused():null}function D(){h&&s&&s.pause()}function O(){return h&&s?s.isSeeking():null}function P(e,n,i){h&&s&&(e!==(isNaN(y)?s.getTime():y)&&((v=!0===i)||(y=e,t.trigger(ee.default.PLAYBACK_SEEK_ASKED)),r.info("Requesting seek to time: "+e+(v?" (internal)":"")),s.setCurrentTime(e,n)))}function L(){return h&&s?s.getTime():null}function F(){var e=L();if(p&&!isNaN(E)){var t=E/1e3;e>t&&(e-=t)}return e}function x(){return h&&s?s.getPlaybackRate():null}function U(){return h&&s?s.getEnded():null}function k(){return p}function B(){if(!p||isNaN(E))return NaN;var e=F();if(isNaN(e)||0===e)return 0;var t=(new Date).getTime()+1e3*u.getClientTimeOffset();return Math.max(((t-E-1e3*e)/1e3).toFixed(3),0)}function G(){m=!1,l=!1,f=NaN,c=0,E=0,y=NaN,s&&(t.off(ee.default.STREAM_INITIALIZED,R,this),t.off(ee.default.DATA_UPDATE_COMPLETED,K,this),t.off(ee.default.BUFFER_LEVEL_STATE_CHANGED,_e,this),t.off(ee.default.LOADING_PROGRESS,me,this),t.off(ee.default.PLAYBACK_PROGRESS,de,this),t.off(ee.default.PLAYBACK_TIME_UPDATED,de,this),t.off(ee.default.PLAYBACK_ENDED,le,this),t.off(ee.default.STREAM_INITIALIZING,ye,this),q(),s.removeEventListener("canplay",V),s.removeEventListener("play",z),s.removeEventListener("waiting",W),s.removeEventListener("playing",X),s.removeEventListener("pause",Q),s.removeEventListener("error",fe),s.removeEventListener("seeking",te),s.removeEventListener("seeked",re),s.removeEventListener("timeupdate",ie),s.removeEventListener("progress",ae),s.removeEventListener("ratechange",oe),s.removeEventListener("loadedmetadata",se),s.removeEventListener("stalled",Ee),s.removeEventListener("ended",ue)),d=null,s=null,h=null,p=null}function j(e){var t=b.getURIFragmentData();if(!t||!t.t)return NaN;var n=i.getStreams()[0].getStreamInfo().start;t.t=t.t.split(",")[0];var r=-1!==t.t.indexOf("posix:")?"now"===t.t.substring(6)?Date.now()/1e3:parseInt(t.t.substring(6)):NaN;return e&&!isNaN(r)?r-E/1e3:parseInt(t.t)+n}function Y(){if(null===d){d=setInterval((function(){var e;t.trigger(ee.default.WALLCLOCK_TIME_UPDATED,{isDynamic:p,time:new Date}),k()&&C()&&(e=Date.now(),(!_||e>_+500)&&(_=e,ie()))}),I.get().streaming.wallclockTimeUpdateInterval)}}function q(){clearInterval(d),d=null}function H(e){if(!C()&&p&&0!==s.getReadyState()){var t=F(),n=function(e,t){var n=a.getCurrentDVRInfo(t),i=n?n.range:null;return i?(r.debug("Checking DVR window for at "+e+" with DVR window range "+i.start+" - "+i.end),e>i.end?Math.max(i.end-c,i.start):e>0&&e+.25<i.start&&Math.abs(e-i.start)<31536e4?i.start:e):NaN}(t,e);!isNaN(n)&&n!==t&&!O()&&(r.debug("UpdateCurrentTime: Seek to actual time: "+n+" from currentTime: "+t),P(n))}}function K(e){if(!e.error){var t=o.convertDataToRepresentationInfo(e.currentRepresentation),n=t?t.mediaInfo.streamInfo:null;null!==n&&h.id===n.id&&(h=n,H())}}function V(){t.trigger(ee.default.CAN_PLAY)}function z(){r.info("Native video element event: play"),H(),Y(),t.trigger(ee.default.PLAYBACK_STARTED,{startTime:L()})}function W(){r.info("Native video element event: waiting"),t.trigger(ee.default.PLAYBACK_WAITING,{playingTime:L()})}function X(){r.info("Native video element event: playing"),t.trigger(ee.default.PLAYBACK_PLAYING,{playingTime:L()})}function Q(){r.info("Native video element event: pause"),t.trigger(ee.default.PLAYBACK_PAUSED,{ended:U()})}function te(){if(v)v=!1;else{var e=L();isNaN(y)||y===e||(e=y),y=NaN,r.info("Seeking to: "+e),Y(),t.trigger(ee.default.PLAYBACK_SEEKING,{seekTime:e})}}function re(){r.info("Native video element event: seeked"),t.trigger(ee.default.PLAYBACK_SEEKED)}function ie(){h&&t.trigger(ee.default.PLAYBACK_TIME_UPDATED,{timeToEnd:w(),time:L()})}function ae(){t.trigger(ee.default.PLAYBACK_PROGRESS)}function oe(){var e=x();r.info("Native video element event: ratechange: ",e),t.trigger(ee.default.PLAYBACK_RATE_CHANGED,{playbackRate:e})}function se(){r.info("Native video element event: loadedmetadata"),t.trigger(ee.default.PLAYBACK_METADATA_LOADED),Y()}function ue(){r.info("Native video element event: ended"),D(),q();var e=i?i.getActiveStreamInfo():null;e&&t.trigger(ee.default.PLAYBACK_ENDED,{isLast:e.isLast})}function le(e){if(d&&e.isLast){r.info("onPlaybackEnded -- PLAYBACK_ENDED but native video element didn't fire ended");var t=e.seekTime?e.seekTime:N();s.setCurrentTime(t),D(),q()}}function fe(e){var n=e.target||e.srcElement;t.trigger(ee.default.PLAYBACK_ERROR,{error:n.error})}function de(){p&&ce()&&I.get().streaming.liveCatchup.playbackRate>0&&!C()&&!O()&&(function(){try{if(ce()&&I.get().streaming.liveCatchup.playbackRate>0&&L()>0){var e=pe(),t=B(),n=g.getLiveDelay(),r=g.getLiveCatchupLatencyThreshold(),i=I.get().streaming.liveCatchup.minDrift;if(e===$.default.LIVE_CATCHUP_MODE_LOLP){var a=he(),o=I.get().streaming.liveCatchup.playbackBufferMin;return function(e,t,n,r,i,a){try{var o=Math.abs(e-t);return(isNaN(a)||e<=a)&&(o>n||r<i)}catch(e){return!1}}(t,n,i,a,o,r)}return function(e,t,n,r){try{return Math.abs(e-t)>r&&(isNaN(n)||e<=n)}catch(e){return!1}}(t,n,r,i)}}catch(e){return!1}}()?function(){if(s){var e=void 0,t=s.getPlaybackRate(),n=I.get().streaming.liveCatchup.playbackRate,i=B(),o=g.getLiveDelay(),u=he();if(pe()===$.default.LIVE_CATCHUP_MODE_LOLP){I.get().streaming.liveCatchup.minDrift;var l=I.get().streaming.liveCatchup.playbackBufferMin;e=function(e,t,n,i,a,o,s){var u=e,l=void 0;if(o<a){var f=5*(o-a),d=2*u/(1+Math.pow(Math.E,-f));l=1-u+d,r.debug("[LoL+ playback control_buffer-based] bufferLevel: "+o+", newRate: "+l)}else{if(Math.abs(t-n)<=.02*n)l=1;else{var c=5*(t-n),h=2*u/(1+Math.pow(Math.E,-c));l=1-u+h}r.debug("[LoL+ playback control_latency-based] latency: "+t+", newRate: "+l)}A&&o>n/2&&(A=!1);Math.abs(s-l)<=S&&(l=null);return{newRate:l}}(n,i,o,0,l,u,t)}else e=function(e,t,n,r,i){var a=e,o=t-n,s=5*o,u=2*a/(1+Math.pow(Math.E,-s)),l=1-a+u;A&&(r>n/2?A=!1:o>0&&(l=1));Math.abs(i-l)<=S&&(l=null);return{newRate:l}}(n,i,o,u,t);var f=e.newRate;f&&s.setPlaybackRate(f);var d=i-o;I.get().streaming.liveCatchup.maxDrift>0&&!T&&d>I.get().streaming.liveCatchup.maxDrift?(r.info("Low Latency catchup mechanism. Latency too high, doing a seek to live point"),T=!0,P(((c=a.getCurrentDVRInfo())?c.range:null).end-g.getLiveDelay(),!0,!1)):T=!1}var c}():ge())}function ce(){return I.get().streaming.liveCatchup.enabled||I.get().streaming.lowLatencyEnabled}function he(){var e=null;return i.getActiveStreamProcessors().forEach((function(t){var n=t.getBufferLevel();e=null===e?n:Math.min(e,n)})),e}function pe(){var e=I.get().streaming.liveCatchup.playbackBufferMin;return I.get().streaming.liveCatchup.mode!==$.default.LIVE_CATCHUP_MODE_LOLP||null===e||isNaN(e)?$.default.LIVE_CATCHUP_MODE_DEFAULT:$.default.LIVE_CATCHUP_MODE_LOLP}function ge(){s&&s.setPlaybackRate(1)}function me(e){if(!1===e.stream&&I.get().streaming.lowLatencyEnabled&&!isNaN(e.request.duration)){var t=1.2*e.request.duration;if(t>g.getLiveDelay()){r.warn("Browser does not support fetch API with StreamReader. Increasing live delay to be 20% higher than segment duration:",t.toFixed(2));var n={streaming:{liveDelay:t}};I.update(n)}}}function _e(e){e.streamId===h.id&&(ce()?e.state!==Z.default.BUFFER_EMPTY||O()||A||(A=!0,ge()):s.setStallState(e.mediaType,e.state===Z.default.BUFFER_EMPTY))}function Ee(e){t.trigger(ee.default.PLAYBACK_STALLED,{e:e})}function ye(e){!function(e,t){if(e&&e.manifestInfo&&e.manifestInfo.serviceDescriptions){for(var n=void 0,i=0;i<e.manifestInfo.serviceDescriptions.length;i++){var a=e.manifestInfo.serviceDescriptions[i];if(a.schemeIdUri===$.default.SERVICE_DESCRIPTION_LL_SCHEME){n=a;break}}n&&t&&t.supplementalProperties&&"true"===t.supplementalProperties[$.default.SUPPLEMENTAL_PROPERTY_LL_SCHEME]&&(n.latency&&n.latency.target>0&&(r.debug("Apply LL properties coming from service description. Target Latency (ms):",n.latency.target),I.update({streaming:{lowLatencyEnabled:!0,liveDelay:n.latency.target/1e3,liveCatchup:{minDrift:n.latency.max>n.latency.target?(n.latency.max-n.latency.target)/1e3:void 0}}})),n.playbackRate&&n.playbackRate.max>1&&(r.debug("Apply LL properties coming from service description. Max PlaybackRate:",n.playbackRate.max),I.update({streaming:{lowLatencyEnabled:!0,liveCatchup:{playbackRate:n.playbackRate.max-1}}})))}}(e.streamInfo,e.mediaInfo)}return n={initialize:function(e,n,r){h=e,s.addEventListener("canplay",V),s.addEventListener("play",z),s.addEventListener("waiting",W),s.addEventListener("playing",X),s.addEventListener("pause",Q),s.addEventListener("error",fe),s.addEventListener("seeking",te),s.addEventListener("seeked",re),s.addEventListener("timeupdate",ie),s.addEventListener("progress",ae),s.addEventListener("ratechange",oe),s.addEventListener("loadedmetadata",se),s.addEventListener("stalled",Ee),s.addEventListener("ended",ue),p=h.manifestInfo.isDynamic,T=!1,A=!1,l=!0===n,f=r,v=!1;var i="undefined"!=typeof navigator?navigator.userAgent.toLowerCase():"",a=/safari/.test(i)&&!/chrome/.test(i);S=a?.25:.02,t.on(ee.default.STREAM_INITIALIZED,R,this),t.on(ee.default.DATA_UPDATE_COMPLETED,K,this),t.on(ee.default.LOADING_PROGRESS,me,this),t.on(ee.default.BUFFER_LEVEL_STATE_CHANGED,_e,this),t.on(ee.default.PLAYBACK_PROGRESS,de,this),t.on(ee.default.PLAYBACK_TIME_UPDATED,de,this),t.on(ee.default.PLAYBACK_ENDED,le,this,{priority:J.default.EVENT_PRIORITY_HIGH}),t.on(ee.default.STREAM_INITIALIZING,ye,this),m&&(m=!1,M())},setConfig:function(e){e&&(e.streamController&&(i=e.streamController),e.dashMetrics&&(a=e.dashMetrics),e.mediaPlayerModel&&(g=e.mediaPlayerModel),e.adapter&&(o=e.adapter),e.videoModel&&(s=e.videoModel),e.timelineConverter&&(u=e.timelineConverter),e.uriFragmentModel&&(b=e.uriFragmentModel),e.settings&&(I=e.settings))},getStartTimeFromUriParameters:j,getTimeToStreamEnd:w,getTime:L,getNormalizedTime:F,getPlaybackRate:x,getPlayedRanges:function(){return h&&s?s.getPlayedRanges():null},getEnded:U,getIsDynamic:k,getStreamController:function(){return i},computeAndSetLiveDelay:function(e,t,n){var r,i=void 0,a=void 0,s=!isNaN(e)&&isFinite(e)?e:NaN,u=o.getSuggestedPresentationDelay();if(i=I.get().streaming.lowLatencyEnabled?0:g.getLiveDelay()?g.getLiveDelay():null===I.get().streaming.liveDelayFragmentCount||isNaN(I.get().streaming.liveDelayFragmentCount)||isNaN(s)?!0===I.get().streaming.useSuggestedPresentationDelay&&null!==u&&!isNaN(u)&&u>0?u:isNaN(s)?isNaN(n)?4*h.manifestInfo.minBufferTime:4*n:4*s:s*I.get().streaming.liveDelayFragmentCount,null!==(r=o.getAvailabilityStartTime())&&(E=r),t>0){var l=Math.max(t-10,t/2);a=Math.min(i,l)}else a=i;return c=a,a},getLiveDelay:function(){return c},setLiveDelay:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];t&&e<c||(c=e)},getCurrentLiveLatency:B,play:M,isPaused:C,pause:D,isSeeking:O,getStreamEndTime:N,seek:P,updateCurrentTime:H,reset:G},r=(0,ne.default)(e).getInstance().getLogger(n),G(),n}ie.__dashjs_factory_name="PlaybackController";var ae=te.default.getSingletonFactory(ie),oe=Object.defineProperty({default:ae},"__esModule",{value:!0});function se(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var ue=function e(){se(this,e),this.tcpid=null,this.type=null,this.url=null,this.actualurl=null,this.range=null,this.trequest=null,this.tresponse=null,this.responsecode=null,this.interval=null,this.trace=[],this._stream=null,this._tfinish=null,this._mediaduration=null,this._quality=null,this._responseHeaders=null,this._serviceLocation=null};ue.GET="GET",ue.HEAD="HEAD",ue.MPD_TYPE="MPD",ue.XLINK_EXPANSION_TYPE="XLinkExpansion",ue.INIT_SEGMENT_TYPE="Initializa