videojs-contrib-dash
Version:
A Video.js source-handler providing MPEG-DASH playback.
2 lines • 625 kB
JavaScript
/*! @name videojs-contrib-dash @version 4.1.0 @license Apache-2.0 */
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("video.js"),require("global/window"),require("global/document")):"function"==typeof define&&define.amd?define(["video.js","global/window","global/document"],t):e.videojsDash=t(e.videojs,e.window,e.document)}(this,function(u,o,n){"use strict";u=u&&u.hasOwnProperty("default")?u.default:u,o=o&&o.hasOwnProperty("default")?o.default:o,n=n&&n.hasOwnProperty("default")?n.default:n;var l="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function e(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function t(e,t){return e(t={exports:{}},t.exports),t.exports}var d=t(function(e,t){function o(e){var t=e;return d.hasOwnProperty(e)&&(t=d[e]),String.fromCharCode(t)}function s(e){for(var t=[],n=0;n<e.length;n++)t.push(e[n].toString(16));return t}function u(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}function n(e,t,n,r,i,a){this.uchar=e||" ",this.penState=new u(t,n,r,i,a)}function r(){this.chars=[];for(var e=0;e<32;e++)this.chars.push(new n);this.pos=0,this.currPenState=new u}function i(){this.rows=[];for(var e=0;e<15;e++)this.rows.push(new r);this.currRow=14,this.nrRollUpRows=null,this.reset()}function a(e,t){this.chNr=e,this.outputFilter=t,this.mode=null,this.verbose=0,this.displayedMemory=new i,this.nonDisplayedMemory=new i,this.lastOutputScreen=new i,this.currRollUpRow=this.displayedMemory.rows[14],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null}function l(e,t,n){this.field=e||1,this.outputs=[t,n],this.channels=[new a(1,t),new a(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}}var d,f,c,h,g,p,_;t=t,d={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},f={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},c={17:2,18:4,21:6,22:8,23:10,19:13,20:15},h={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},g={25:2,26:4,29:6,30:8,31:10,27:13,28:15},p=["white","green","blue","cyan","red","yellow","magenta","black","transparent"],_={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)}},u.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}},n.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()}},r.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?(_.log("ERROR","Negative cursor position "+this.pos),this.pos=0):32<this.pos&&(_.log("ERROR","Too large cursor position "+this.pos),this.pos=32)},moveCursor:function(e){var t=this.pos+e;if(1<e)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){144<=e&&this.backSpace();var t=o(e);32<=this.pos?_.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){for(var 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)}},i.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){_.log("INFO","setCursor: "+e),this.rows[this.currRow].setCursor(e)},setPAC:function(e){_.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];null!==e.indent&&(t=e.indent,t=Math.max(t-1,0),n.setCursor(e.indent),e.color=n.chars[t].penState.foreground);e={foreground:e.color,underline:e.underline,italics:e.italics,background:"black",flash:!1};this.setPen(e)},setBkgData:function(e){_.log("INFO","bkgData = "+JSON.stringify(e)),this.backSpace(),this.setPen(e),this.insertChar(32)},setRollUpRows:function(e){this.nrRollUpRows=e},rollUp:function(){var e;null!==this.nrRollUpRows?(_.log("TEXT",this.getDisplayText()),e=this.currRow+1-this.nrRollUpRows,(e=this.rows.splice(e,1)[0]).clear(),this.rows.splice(this.currRow,0,e),_.log("INFO","Rolling up")):_.log("DEBUG","roll_up but nrRollUpRows not set yet")},getDisplayText:function(e){e=e||!1;for(var t,n=[],r="",i=0;i<15;i++){var a=this.rows[i].getTextString();a&&(t=i+1,e?n.push("Row "+t+': "'+a+'"'):n.push(a.trim()))}return r=0<n.length?e?"["+n.join(" | ")+"]":n.join("\n"):r},getTextAndFormat:function(){return this.rows}},a.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,_.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";_.log("INFO",n+": "+this.writeScreen.getDisplayText(!0)),"MODE_PAINT-ON"!==this.mode&&"MODE_ROLL-UP"!==this.mode||(_.log("TEXT","DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())},cc_RCL:function(){_.log("INFO","RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")},cc_BS:function(){_.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(){_.log("INFO","DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()},cc_RU:function(e){_.log("INFO","RU("+e+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(e)},cc_FON:function(){_.log("INFO","FON - Flash On"),this.writeScreen.setPen({flash:!0})},cc_RDC:function(){_.log("INFO","RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")},cc_TR:function(){_.log("INFO","TR"),this.setMode("MODE_TEXT")},cc_RTD:function(){_.log("INFO","RTD"),this.setMode("MODE_TEXT")},cc_EDM:function(){_.log("INFO","EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate()},cc_CR:function(){_.log("CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate()},cc_ENM:function(){_.log("INFO","ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()},cc_EOC:function(){var e;_.log("INFO","EOC - End Of Caption"),"MODE_POP-ON"===this.mode&&(e=this.displayedMemory,this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=e,this.writeScreen=this.nonDisplayedMemory,_.log("TEXT","DISP: "+this.displayedMemory.getDisplayText())),this.outputDataUpdate()},cc_TO:function(e){_.log("INFO","TO("+e+") - Tab Offset"),this.writeScreen.moveCursor(e)},cc_MIDROW:function(e){var t={flash:!1};t.underline=e%2==1,t.italics=46<=e,t.italics?t.foreground="white":(e=Math.floor(e/2)-16,t.foreground=["white","green","blue","cyan","red","yellow","magenta"][e]),_.log("INFO","MIDROW: "+JSON.stringify(t)),this.writeScreen.setPen(t)},outputDataUpdate:function(){var e=_.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))}},l.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=!1;this.lastTime=e,_.setTime(e);for(var i=0;i<t.length;i+=2){var a=127&t[i],o=127&t[i+1];16<=a&&a<=31&&a===this.lastCmdA&&o===this.lastCmdB?(this.lastCmdA=null,this.lastCmdB=null,_.log("DEBUG","Repeated command ("+s([a,o])+") is dropped")):0!=a||0!=o?(_.log("DATA","["+s([t[i],t[i+1]])+"] -> ("+s([a,o])+")"),(n=(n=(n=(n=this.parseCmd(a,o))||this.parseMidrow(a,o))||this.parsePAC(a,o))||this.parseBackgroundAttributes(a,o))||(r=this.parseChars(a,o))&&(this.currChNr&&0<=this.currChNr?this.channels[this.currChNr-1].insertChars(r):_.log("WARNING","No channel found yet. TEXT-MODE?")),n?this.dataCounters.cmd+=2:r?this.dataCounters.char+=2:(this.dataCounters.other+=2,_.log("WARNING","Couldn't parse cleaned data "+s([a,o])+" orig: "+s([t[i],t[i+1]])))):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;var n=20===e||21===e||23===e?1:2,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 _.log("ERROR","Mismatch channel in midrow parsing"),!1;n=this.channels[n-1];return n.insertChars([32]),n.cc_MIDROW(t),_.log("DEBUG","MIDROW ("+s([e,t])+")"),this.lastCmdA=e,this.lastCmdB=t,!0}return!1},parsePAC:function(e,t){var n=null;if(!((17<=e&&e<=23||25<=e&&e<=31)&&64<=t&&t<=127)&&!((16===e||24===e)&&64<=t&&t<=95))return!1;var r=e<=23?1:2,n=(64<=t&&t<=95?1==r?f:h:1==r?c:g)[e],n=this.interpretPAC(n,t);return this.channels[r-1].setPAC(n),this.lastCmdA=e,this.lastCmdB=t,this.currChNr=r,!0},interpretPAC:function(e,t){var n=t,e={color:null,italics:!1,indent:null,underline:!1,row:e},n=95<t?t-96:t-64;return e.underline=1==(1&n),n<=13?e.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(n/2)]:n<=15?(e.italics=!0,e.color="white"):e.indent=4*Math.floor((n-16)/2),e},parseChars:function(e,t){var n,r=null,i=null,a=null;return 17<=(a=25<=e?(r=2,e-8):(r=1,e))&&a<=19?(n=t,n=17===a?t+80:18===a?t+112:t+144,_.log("INFO","Special char '"+o(n)+"' in channel "+r),i=[n],this.lastCmdA=e,this.lastCmdB=t):32<=e&&e<=127&&(i=0===t?[e]:[e,t],this.lastCmdA=null,this.lastCmdB=null),i&&(t=s(i),_.log("DEBUG","Char codes = "+t.join(","))),i},parseBackgroundAttributes:function(e,t){var n,r;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=p[r],t%2==1&&(n.background=n.background+"_semi")):45===t?n.background="transparent":(n.foreground="black",47===t&&(n.underline=!0)),r=e<24?1:2,this.channels[r-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)}},t.logger=_,t.PenState=u,t.CaptionScreen=i,t.Cea608Parser=l,t.findCea608Nalus=function(e,t,n){for(var r,i=t,a=[];i<t+n;){if(r=e.getUint32(i),6==(31&e.getUint8(i+4)))for(var o=i+5,s=-1;o<i+4+r-1;){for(var s=0,u=255;255===u;)s+=u=e.getUint8(o),o++;for(var l=0,u=255;255===u;)l+=u=e.getUint8(o),o++;!function(e,t,n,r){if(4!==e||t<8)return null;var i=n.getUint8(r),e=n.getUint16(r+1),t=n.getUint32(r+3),r=n.getUint8(r+7);return 181==i&&49==e&&1195456820==t&&3==r}(s,l,e,o)||a.push([o,l]),o+=l}i+=r+4}return a},t.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++;o=e.getUint8(n);n++,s&&(127&l)+(127&o)!=0&&(0==u?(r[0].push(l),r[0].push(o)):1==u&&(r[1].push(l),r[1].push(o)))}return r}}),x=t(function(e,t){function r(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)}}function n(){!function(e){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}(this),this.init()}Object.defineProperty(t,"__esModule",{value:!0});var i=new(function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}(n,[{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_HIGHEST_BITRATE="highestBitrate",this.TRACK_SELECTION_MODE_WIDEST_RANGE="widestRange",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"}}]),n);t.default=i});e(x);var w=t(function(e,t){function r(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)}}function n(){!function(e){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}(this),this.init()}Object.defineProperty(t,"__esModule",{value:!0});var i=new(function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}(n,[{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"}}]),n);t.default=i});e(w);var D=t(function(e,t){function r(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)}}function n(){!function(e){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}(this),this.init()}Object.defineProperty(t,"__esModule",{value:!0});var i=new(function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}(n,[{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"}}]),n);t.default=i});e(D);var k=t(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var u,a,r,n,i=(u=void 0,a=[],r={},n={},u={extend:function(e,t,n,r){!r[e]&&t&&(r[e]={instance:t,override:n})},getSingletonInstance:o,setSingletonInstance:function(e,t,n){for(var r in a){var i=a[r];if(i.context===e&&i.name===t)return void(a[r].instance=n)}a.push({name:t,context:e,instance:n})},deleteSingletonInstances:function(t){a=a.filter(function(e){return e.context!==t})},getSingletonFactory:function(n){var e=s(n.__dashjs_factory_name,r);return e||(e=function(e){var t=void 0;return void 0===e&&(e={}),{getInstance:function(){return(t=t||o(e,n.__dashjs_factory_name))||(t=d(n,e,arguments),a.push({name:n.__dashjs_factory_name,context:e,instance:t})),t}}},r[n.__dashjs_factory_name]=e),e},getSingletonFactoryByName:function(e){return r[e]},updateSingletonFactory:function(e,t){l(e,t,r)},getClassFactory:function(t){var e=s(t.__dashjs_factory_name,n);return e||(e=function(e){return void 0===e&&(e={}),{create:function(){return d(t,e,arguments)}}},n[t.__dashjs_factory_name]=e),e},getClassFactoryByName:function(e){return n[e]},updateClassFactory:function(e,t){l(e,t,n)}});function o(e,t){for(var n in a){n=a[n];if(n.context===e&&n.name===t)return n.instance}return null}function s(e,t){return t[e]}function l(e,t,n){e in n&&(n[e]=t)}function d(e,t,n){var r=void 0,i=e.__dashjs_factory_name,a=t[i];if(a){var o,s=a.instance;if(!a.override)return s.apply({context:t,factory:u},n);for(o in r=e.apply({context:t},n),s=s.apply({context:t,factory:u,parent:r},n))r.hasOwnProperty(o)&&(r[o]=s[o])}else r=e.apply({context:t},n);return r.getClassName=function(){return i},r}t.default=i});e(k);var f=t(function(e,t){function r(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)}}Object.defineProperty(t,"__esModule",{value:!0});var n=(function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}(i,[{key:"extend",value:function(e,t){if(e){var n,r=!!t&&t.override,i=!!t&&t.publicOnly;for(n in e)!e.hasOwnProperty(n)||this[n]&&!r||i&&-1===e[n].indexOf("public_")||(this[n]=e[n])}}}]),i);function i(){!function(e){if(!(e instanceof i))throw new TypeError("Cannot call a class as a function")}(this)}t.default=n});e(f);var c=t(function(e,t){var n;function r(){!function(e){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}(this);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,(r.__proto__||Object.getPrototypeOf(r)).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}Object.defineProperty(t,"__esModule",{value:!0});var i=new(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)}(r,((n=f)&&n.__esModule?n:{default:n}).default),r);t.default=i});e(c);var U=t(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n,r=(n=k)&&n.__esModule?n:{default:n};function i(){var o={};function s(e,n,r){var i=-1;return o[e]&&o[e].some(function(e,t){if(e&&e.callback===n&&(!r||r===e.scope))return i=t,!0}),i}return{on:function(n,e,t){var r=3<arguments.length&&void 0!==arguments[3]?arguments[3]:{};if(!n)throw new Error("event type cannot be null or undefined");if(!e||"function"!=typeof e)throw new Error("listener must be a function: "+e);var i,a=r.priority||0;0<=s(n,e,t)||(o[n]=o[n]||[],i={callback:e,scope:t,priority:a},t&&t.getStreamId&&(i.streamId=t.getStreamId()),t&&t.getType&&(i.mediaType=t.getType()),r&&r.mode&&(i.mode=r.mode),o[n].some(function(e,t){if(e&&a>e.priority)return o[n].splice(t,0,i),!0})||o[n].push(i))},off:function(e,t,n){e&&t&&o[e]&&((n=s(e,t,n))<0||(o[e][n]=null))},trigger:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{};if(e&&o[e]){if((t=t||{}).hasOwnProperty("type"))throw new Error("'type' is a reserved word for event dispatching");t.type=e,n.streamId&&(t.streamId=n.streamId),n.mediaType&&(t.mediaType=n.mediaType),o[e].filter(function(e){return!!e&&((!n.streamId||!e.streamId||e.streamId===n.streamId)&&((!n.mediaType||!e.mediaType||e.mediaType===n.mediaType)&&!(n.mode&&e.mode&&e.mode!==n.mode||!e.mode&&n.mode&&n.mode===c.EVENT_MODE_ON_RECEIVE)))}).forEach(function(e){return e&&e.callback.call(e.scope,t)})}},reset:function(){o={}}}}i.__dashjs_factory_name="EventBus";var a=r.default.getSingletonFactory(i);a.EVENT_PRIORITY_LOW=0,a.EVENT_PRIORITY_HIGH=5e3,r.default.updateSingletonFactory(i.__dashjs_factory_name,a),t.default=a});e(U);var h=t(function(e,t){var n;Object.defineProperty(t,"__esModule",{value:!0});var r=(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)}(i,((n=f)&&n.__esModule?n:{default:n}).default),i);function i(){!function(e){if(!(e instanceof i))throw new TypeError("Cannot call a class as a function")}(this);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,(i.__proto__||Object.getPrototypeOf(i)).call(this));return 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.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}t.default=r});e(h);var B=t(function(e,t){var n;function r(){return function(e){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}(this),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,(r.__proto__||Object.getPrototypeOf(r)).apply(this,arguments))}Object.defineProperty(t,"__esModule",{value:!0});var i=new(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)}(r,((n=h)&&n.__esModule?n:{default:n}).default),r);t.default=i});e(B);var Y=t(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var i=r(U),h=r(B),n=r(k);function r(e){return e&&e.__esModule?e:{default:e}}var a=1,o=2,g=3,p=4,_=5;function s(e){e=e||{};var t=this.context,s=(0,i.default)(t).getInstance(),u=e.settings,l=[],e=void 0,d=void 0,f=void 0,c=void 0;function n(e){return(e&&e.bind?e:window.console.log).bind(window.console)}function r(e,t){var n,r="";d&&(n=(new Date).getTime(),r+="["+(n-c)+"]"),f&&t&&t.getClassName&&(r+="["+t.getClassName()+"]",t.getType&&(r+="["+t.getType()+"]")),0<r.length&&(r+=" ");for(var i=arguments.length,a=Array(2<i?i-2:0),o=2;o<i;o++)a[o-2]=arguments[o];Array.apply(null,a).forEach(function(e){r+=e+" "}),l[e]&&u.get().debug.logLevel>=e&&l[e](r),u&&u.get().debug.dispatchEvent&&s.trigger(h.default.LOG,{message:r,level:e})}return e={getLogger:function(e){return{fatal:function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];r.apply(void 0,[a,this].concat(t))}.bind(e),error:function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];r.apply(void 0,[o,this].concat(t))}.bind(e),warn:function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];r.apply(void 0,[g,this].concat(t))}.bind(e),info:function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];r.apply(void 0,[p,this].concat(t))}.bind(e),debug:function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];r.apply(void 0,[_,this].concat(t))}.bind(e)}},setLogTimestampVisible:function(e){d=e},setCalleeNameVisible:function(e){f=e}},f=d=!0,c=(new Date).getTime(),"undefined"!=typeof window&&window.console&&(l[a]=n(window.console.error),l[o]=n(window.console.error),l[g]=n(window.console.warn),l[p]=n(window.console.info),l[_]=n(window.console.debug)),e}s.__dashjs_factory_name="Debug";var u=n.default.getSingletonFactory(s);u.LOG_LEVEL_NONE=0,u.LOG_LEVEL_FATAL=a,u.LOG_LEVEL_ERROR=o,u.LOG_LEVEL_WARNING=g,u.LOG_LEVEL_INFO=p,u.LOG_LEVEL_DEBUG=_,n.default.updateSingletonFactory(s.__dashjs_factory_name,u),t.default=u});e(Y);var g=t(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var ge=r(x),pe=r(D),_e=r(U),me=r(B),n=r(k),Ee=r(Y);function r(e){return e&&e.__esModule?e:{default:e}}function i(){var e=this.context,r=(0,_e.default)(e).getInstance(),t=void 0,u=void 0,i=void 0,o=void 0,s=void 0,l=void 0,n=void 0,a=void 0,d=void 0,f=void 0,c=void 0,h=void 0,g=void 0,p=void 0,_=void 0,m=void 0,E=void 0,y=void 0,v=void 0,T=void 0,A=void 0,S=void 0,b=void 0;function I(e){var t,n;a&&isNaN(d)||(t=d,isNaN(t)&&(g?(t=e.liveStartTime,(n=(e=o.getCurrentDVRInfo())?e.range:null)&&(e=G(!0),isNaN(e)||(u.info("Start time from URI parameters: "+e),t=Math.max(Math.min(t,e),n.start)))):(t=h.start,n=G(!1),!isNaN(n)&&n<t+h.duration&&(u.info("Start time from URI parameters: "+n),t=Math.max(t,n)))),isNaN(t)||t===l.getTime()||(r.trigger(me.default.PLAYBACK_SEEKING,{seekTime:t}),O(t,!1,!0)))}function R(){return parseFloat((D()-P()).toFixed(5))}function D(){return h.start+h.duration}function M(){h&&l&&l.getElement()?l.play():_=!0}function N(){return h&&l?l.isPaused():null}function C(){h&&l&&l.pause()}function w(){return h&&l?l.isSeeking():null}function O(e,t,n){h&&l&&e!==(isNaN(y)?l.getTime():y)&&(!0===n?(l.removeEventListener("seeking",Q),u.info("Requesting internal seek to time: "+e)):(y=e,r.trigger(me.default.PLAYBACK_SEEK_ASKED),u.info("Requesting seek to time: "+e)),l.setCurrentTime(e,t))}function P(){return h&&l?l.getTime():null}function L(){var e,t=P();return!g||isNaN(E)||(e=E/1e3)<t&&(t-=e),t}function F(){return h&&l?l.getPlaybackRate():null}function x(){return h&&l?l.getEnded():null}function U(){return g}function k(){if(!g||isNaN(E))return NaN;var e=L();if(isNaN(e)||0===e)return 0;var t=(new Date).getTime()+1e3*n.getClientTimeOffset();return Math.max(((t-E-1e3*e)/1e3).toFixed(3),0)}function B(){a=_=!1,E=c=0,y=d=NaN,l&&(r.off(me.default.STREAM_INITIALIZED,I,this),r.off(me.default.DATA_UPDATE_COMPLETED,H,this),r.off(me.default.BUFFER_LEVEL_STATE_CHANGED,fe,this),r.off(me.default.LOADING_PROGRESS,de,this),r.off(me.default.PLAYBACK_PROGRESS,ae,this),r.off(me.default.PLAYBACK_TIME_UPDATED,ae,this),r.off(me.default.PLAYBACK_ENDED,re,this),r.off(me.default.STREAM_INITIALIZING,he,this),Y(),l.removeEventListener("canplay",K),l.removeEventListener("play",V),l.removeEventListener("waiting",z),l.removeEventListener("playing",W),l.removeEventListener("pause",X),l.removeEventListener("error",ie),l.removeEventListener("seeking",Q),l.removeEventListener("seeked",Z),l.removeEventListener("timeupdate",$),l.removeEventListener("progress",J),l.removeEventListener("ratechange",ee),l.removeEventListener("loadedmetadata",te),l.removeEventListener("stalled",ce),l.removeEventListener("ended",ne)),g=h=l=f=null}function G(e){var t=S.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 j(){null===f&&(f=setInterval(function(){r.trigger(me.default.WALLCLOCK_TIME_UPDATED,{isDynamic:g,time:new Date}),g&&N()&&function(){var e=Date.now();(!m||m+500<e)&&(m=e,$())}()},b.get().streaming.wallclockTimeUpdateInterval))}function Y(){clearInterval(f),f=null}function q(){var e,t,n;!N()&&g&&0!==l.getReadyState()&&(e=L(),t=e,t=(n=(n=o.getCurrentDVRInfo())?n.range:null)?(u.debug("Checking DVR window for at "+t+" with DVR window range "+n.start+" - "+n.end),t>n.end?Math.max(n.end-c,n.start):0<t&&t+.25<n.start&&Math.abs(t-n.start)<31536e4?n.start:t):NaN,isNaN(t)||t===e||(u.debug("UpdateCurrentTime: Seek to actual time: "+t+" from currentTime: "+e),O(t)))}function H(e){e.error||null!==(e=(e=s.convertDataToRepresentationInfo(e.currentRepresentation))?e.mediaInfo.streamInfo:null)&&h.id===e.id&&(h=e,q())}function K(){r.trigger(me.default.CAN_PLAY)}function V(){u.info("Native video element event: play"),q(),j(),r.trigger(me.default.PLAYBACK_STARTED,{startTime:P()})}function z(){u.info("Native video element event: waiting"),r.trigger(me.default.PLAYBACK_WAITING,{playingTime:P()})}function W(){u.info("Native video element event: playing"),r.trigger(me.default.PLAYBACK_PLAYING,{playingTime:P()})}function X(){u.info("Native video element event: pause"),r.trigger(me.default.PLAYBACK_PAUSED,{ended:x()})}function Q(){var e=P();isNaN(y)||y===e||(e=y),y=NaN,u.info("Seeking to: "+e),j(),r.trigger(me.default.PLAYBACK_SEEKING,{seekTime:e})}function Z(){u.info("Native video element event: seeked"),r.trigger(me.default.PLAYBACK_SEEKED),l.addEventListener("seeking",Q)}function $(){h&&r.trigger(me.default.PLAYBACK_TIME_UPDATED,{timeToEnd:R(),time:P()})}function J(){r.trigger(me.default.PLAYBACK_PROGRESS)}function ee(){var e=F();u.info("Native video element event: ratechange: ",e),r.trigger(me.default.PLAYBACK_RATE_CHANGED,{playbackRate:e})}function te(){u.info("Native video element event: loadedmetadata"),r.trigger(me.default.PLAYBACK_METADATA_LOADED),j()}function ne(){u.info("Native video element event: ended"),C(),Y(),r.trigger(me.default.PLAYBACK_ENDED,{isLast:i.getActiveStreamInfo().isLast})}function re(e){f&&e.isLast&&(u.info("onPlaybackEnded -- PLAYBACK_ENDED but native video element didn't fire ended"),e=e.seekTime||D(),l.setCurrentTime(e),C(),Y())}function ie(e){e=e.target||e.srcElement;r.trigger(me.default.PLAYBACK_ERROR,{error:e.error})}function ae(){var e,t,n,r,i,a;g&&oe()&&0<b.get().streaming.liveCatchup.playbackRate&&!N()&&!w()&&(function(){try{if(oe()&&0<b.get().streaming.liveCatchup.playbackRate&&0<P()){var e=ue(),t=k(),n=p.getLiveDelay(),r=p.getLiveCatchupLatencyThreshold(),i=b.get().streaming.liveCatchup.minDrift;if(e!==ge.default.LIVE_CATCHUP_MODE_LOLP)return function(e,t,n,r){try{var i=Math.abs(e-t);return r<i&&(isNaN(n)||e<=n)}catch(e){return!1}}(t,n,r,i);var a=se(),e=b.get().streaming.liveCatchup.playbackBufferMin;return function(e,t,n,r,i,a){try{var o=Math.abs(e-t);return(isNaN(a)||e<=a)&&(n<o||r<i)}catch(e){return!1}}(t,n,i,a,e,r)}}catch(e){return!1}}()?l&&(i=l.getPlaybackRate(),e=b.get().streaming.liveCatchup.playbackRate,t=k(),a=p.getLiveDelay(),n=se(),(i=(ue()===ge.default.LIVE_CATCHUP_MODE_LOLP?(b.get().streaming.liveCatchup.minDrift,r=b.get().streaming.liveCatchup.playbackBufferMin,function(e,t,n,r,i,a){var o=e,e=void 0;{var s;i<r?(s=5*(i-r),s=2*o/(1+Math.pow(Math.E,-s)),e=1-o+s,u.debug("[LoL+ playback control_buffer-based] bufferLevel: "+i+", newRate: "+e)):(e=Math.abs(t-n)<=.02*n?1:(s=5*(t-n),s=2*o/(1+Math.pow(Math.E,-s)),1-o+s),u.debug("[LoL+ playback control_latency-based] latency: "+t+", newRate: "+e))}T&&n/2<i&&(T=!1);Math.abs(a-e)<=A&&(e=null);return{newRate:e}}(e,t,a,r,n,i)):function(e,t,n,r,i){var a=e,e=t-n,t=5*e,t=2*a/(1+Math.pow(Math.E,-t)),t=1-a+t;T&&(n/2<r?T=!1:0<e&&(t=1));Math.abs(i-t)<=A&&(t=null);return{newRate:t}}(e,t,a,n,i)).newRate)&&l.setPlaybackRate(i),a=t-a,0<b.get().streaming.liveCatchup.maxDrift&&!v&&a>b.get().streaming.liveCatchup.maxDrift?(u.info("Low Latency catchup mechanism. Latency too high, doing a seek to live point"),v=!0,function(){var e=o.getCurrentDVRInfo();O((e?e.range:null).end-p.getLiveDelay(),!0,!1)}()):v=!1):le())}function oe(){return b.get().streaming.liveCatchup.enabled||b.get().streaming.lowLatencyEnabled}function se(){var t=null;return i.getActiveStreamProcessors().forEach(function(e){e=e.getBufferLevel();t=null===t?e:Math.min(t,e)}),t}function ue(){var e=b.get().streaming.liveCatchup.playbackBufferMin;return b.get().streaming.liveCatchup.mode!==ge.default.LIVE_CATCHUP_MODE_LOLP||null===e||isNaN(e)?ge.default.LIVE_CATCHUP_MODE_DEFAULT:ge.default.LIVE_CATCHUP_MODE_LOLP}function le(){l&&l.setPlaybackRate(1)}function de(e){!1!==e.stream||!b.get().streaming.lowLatencyEnabled||isNaN(e.request.duration)||(e=1.2*e.request.duration)>p.getLiveDelay()&&(u.warn("Browser does not support fetch API with StreamReader. Increasing live delay to be 20% higher than segment duration:",e.toFixed(2)),e={streaming:{liveDelay:e}},b.update(e))}function fe(e){e.streamId===h.id&&(oe()?e.state!==pe.default.BUFFER_EMPTY||w()||T||(T=!0,le()):l.setStallState(e.mediaType,e.state===pe.default.BUFFER_EMPTY))}function ce(e){r.trigger(me.default.PLAYBACK_STALLED,{e:e})}function he(e){!function(e,t){if(e&&e.manifestInfo&&e.manifestInfo.serviceDescriptions){for(var n=void 0,r=0;r<e.manifestInfo.serviceDescriptions.length;r++){var i=e.manifestInfo.serviceDescriptions[r];if(i.schemeIdUri===ge.default.SERVICE_DESCRIPTION_LL_SCHEME){n=i;break}}n&&t&&t.supplementalProperties&&"true"===t.supplementalProperties[ge.default.SUPPLEMENTAL_PROPERTY_LL_SCHEME]&&(n.latency&&0<n.latency.target&&(u.debug("Apply LL properties coming from service description. Target Latency (ms):",n.latency.target),b.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&&1<n.playbackRate.max&&(u.debug("Apply LL properties coming from service description. Max PlaybackRate:",n.playbackRate.max),b.update({streaming:{lowLatencyEnabled:!0,liveCatchup:{playbackRate:n.playbackRate.max-1}}})))}}(e.streamInfo,e.mediaInfo)}return t={initialize:function(e,t,n){h=e,l.addEventListener("canplay",K),l.addEventListener("play",V),l.addEventListener("waiting",z),l.addEventListener("playing",W),l.addEventListener("pause",X),l.addEventListener("error",ie),l.addEventListener("seeking",Q),l.addEventListener("seeked",Z),l.addEventListener("timeupdate",$),l.addEventListener("progress",J),l.addEventListener("ratechange",ee),l.addEventListener("loadedmetadata",te),l.addEventListener("stalled",ce),l.addEventListener("ended",ne),g=h.manifestInfo.isDynamic,a=!(T=v=!1)===t,d=n,n="undefined"!=typeof navigator?navigator.userAgent.toLowerCase():"",n=/safari/.test(n)&&!/chrome/.test(n),A=n?.25:.02,r.on(me.default.STREAM_INITIALIZED,I,this),r.on(me.default.DATA_UPDATE_COMPLETED,H,this),r.on(me.default.LOADING_PROGRESS,de,this),r.on(me.default.BUFFER_LEVEL_STATE_CHANGED,fe,this),r.on(me.default.PLAYBACK_PROGRESS,ae,this),r.on(me.default.PLAYBACK_TIME_UPDATED,ae,this),r.on(me.default.PLAYBACK_ENDED,re,this,{priority:_e.default.EVENT_PRIORITY_HIGH}),r.on(me.default.STREAM_INITIALIZING,he,this),_&&(_=!1,M())},setConfig:function(e){e&&(e.streamController&&(i=e.streamController),e.dashMetrics&&(o=e.dashMetrics),e.mediaPlayerModel&&(p=e.mediaPlayerModel),e.adapter&&(s=e.adapter),e.videoModel&&(l=e.videoModel),e.timelineConverter&&(n=e.timelineConverter),e.uriFragmentModel&&(S=e.uriFragmentModel),e.settings&&(b=e.settings))},getStartTimeFromUriParameters:G,getTimeToStreamEnd:R,getTime:P,getNormalizedTime:L,getPlaybackRate:F,getPlayedRanges:function(){return h&&l?l.getPlayedRanges():null},getEnded:x,getIsDynamic:U,getStreamController:function(){return i},computeAndSetLiveDelay:function(e,t,n){var r=void 0,i=void 0,a=void 0,o=!isNaN(e)&&isFinite(e)?e:NaN,e=s.getSuggestedPresentationDelay(),r=b.get().streaming.lowLatencyEnabled?0:p.getLiveDelay()?p.getLiveDelay():null===b.get().streaming.liveDelayFragmentCount||isNaN(b.get().streaming.liveDelayFragmentCount)||isNaN(o)?!0===b.get().streaming.useSuggestedPresentationDelay&&null!==e&&!isNaN(e)&&0<e?e:isNaN(o)?isNaN(n)?4*h.manifestInfo.minBufferTime:4*n:4*o:o*b.get().streaming.liveDelayFragmentCount;return null!==(a=s.getAvailabilityStartTime())&&(E=a),i=0<t?(t=Math.max(t-10,t/2),Math.min(r,t)):r,c=i},getLiveDelay:function(){return c},setLiveDelay:function(e){1<arguments.length&&void 0!==arguments[1]&&arguments[1]&&e<c||(c=e)},getCurrentLiveLatency:k,play:M,isPaused:N,pause:C,isSeeking:w,getStreamEndTime:D,seek:O,reset:B},u=(0,Ee.default)(e).getInstance().getLogger(t),B(),t}i.__dashjs_factory_name="PlaybackController",t.default=n.default.getSingletonFactory(i)});e(g);var We=t(function(e,t){function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});function r(){n(this,r),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}function i(){n(this,i),this.s=null,this.d=null,this.b=[]}r.GET="GET",r.HEAD="HEAD",r.MPD_TYPE="MPD",r.XLINK_EXPANSION_TYPE="XLinkExpansion",r.INIT_SEGMENT_TYPE="InitializationSegment",r.INDEX_SEGMENT_TYPE="IndexSegment",r.MEDIA_SEGMENT_TYPE="MediaSegment",r.BITSTREAM_SWITCHING_SEGMENT_TYPE="BitstreamSwitchingSegment",r.OTHER_TYPE="other",t.HTTPRequest=r,t.HTTPRequestTrace=i});e(We);We.HTTPRequest,We.HTTPRequestTrace;var m=t(function(e,t){function r(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)}}Object.defineProperty(t,"__esModule",{value:!0});var n=(function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}(i,[{key:"isInitializationRequest",value:function(){return this.type&&this.type===We.HTTPRequest.INIT_SEGMENT_TYPE}},{key:"setInfo",value:function(e){this.type=e&&e.init?We.HTTPRequest.INIT_SEGMENT_TYPE:We.HTTPRequest.MEDIA_SEGMENT_TYPE,this.url=e&&e.url?e.url:null,this.range=e&&e.range?e.range.start+"-"+e.range.end:null,this.mediaType=e&&e.mediaType?e.mediaType:null}}]),i);function i(e){!function(e){if(!(e instanceof i))throw new TypeError("Cannot call a class as a function")}(this),this.action=i.ACTION_DOWNLOAD,this.startTime=NaN,this.mediaStartTime=NaN,this.mediaType=null,this.mediaInfo=null,this.type=null,this.duration=NaN,this.timescale=NaN,this.range=null,this.url=e||null,this.serviceLocation=null,this.requestStartDate=null,this.firstByteDate=null,this.requestEndDate=null,this.quality=NaN,this.index=NaN,this.availabilityStartTime=null,this.availabilityEndTime=null,this.wallStartTime=null,this.bytesLoaded=NaN,this.bytesTotal=NaN,this.delayLoadingTime=NaN,this.responseType="arraybuffer",this.representationId=null}n.ACTION_DOWNLOAD="download",n.ACTION_COMPLETE="complete",t.default=n});e(m);var A=t(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=r(k),T=r(m);function r(e){return e&&e.__esModule?e:{default:e}}var A="loading",S="executed";function i(e){var t,n=(e=e||{}).eventBus,r=e.events,i=e.dashMetrics,a=e.fragmentLoader,o=e.debug,s=e.streamInfo,u=e.type,l=void 0,d=void