UNPKG

videojs-contrib-dash-s1

Version:

A Video.js source-handler providing MPEG-DASH playback.

12 lines 388 kB
/** * videojs-contrib-dash-s1 * @version 2.1.5 * @copyright 2016 Brightcove, Inc. * @license Apache-2.0 * * Includes dash.js <https://github.com/Dash-Industry-Forum/dash.js> * Available under a BSD License * <https://github.com/Dash-Industry-Forum/dash.js/blob/development/LICENSE.md> */ !function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.videojsContribDash=e()}}(function(){return function e(t,n,r){function a(o,s){if(!n[o]){if(!t[o]){var u="function"==typeof require&&require;if(!s&&u)return u(o,!0);if(i)return i(o,!0);var l=new Error("Cannot find module '"+o+"'");throw l.code="MODULE_NOT_FOUND",l}var d=n[o]={exports:{}};t[o][0].call(d.exports,function(e){var n=t[o][1][e];return a(n?n:e)},d,d.exports,e,t,n,r)}return n[o].exports}for(var i="function"==typeof require&&require,o=0;o<r.length;o++)a(r[o]);return a}({1:[function(e,t,n){(function(r){"use strict";function a(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(n,"__esModule",{value:!0});var i="undefined"!=typeof window?window.videojs:"undefined"!=typeof r?r.videojs:null,o=a(i),s=e("./html5-dashjs"),u=a(s),l={};l.canHandleSource=function(e){var t=/\.mpd/i;return l.canPlayType(e.type)?"probably":t.test(e.src)?"maybe":""},l.handleSource=function(e,t){return new u["default"](e,t)},l.canPlayType=function(e){var t=/^application\/dash\+xml/i;return t.test(e)?"probably":""},window.MediaSource&&o["default"].getComponent("Html5").registerSourceHandler(l,0),n["default"]=l,t.exports=n["default"]}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./html5-dashjs":2}],2:[function(e,t,n){(function(r){"use strict";function a(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var o=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}}(),s="undefined"!=typeof window?window.videojs:"undefined"!=typeof r?r.videojs:null,u=a(s);e("dashjs/dist/dash.all.debug");var l=function(){function e(t,n){i(this,e);var r=t.src;this.tech_=n,this.el_=n.el(),this.elParent_=this.el_.parentNode,t.src&&(n.isReady_=!1,this.keySystemOptions_=e.buildDashJSProtData(t.keySystemOptions),this.hideErrors(),e.useVideoJSDebug&&e.useVideoJSDebug(u["default"]),e.context_=e.context_||{},this.mediaPlayer_=window.dashjs.MediaPlayer(e.context_).create(),this.mediaPlayer_.initialize(),this.mediaPlayer_.setLimitBitrateByPortal(!0),this.mediaPlayer_.attachView(this.el_),n.options_.autoplay||this.mediaPlayer_.setAutoPlay(!1),this.mediaPlayer_.retrieveManifest(r,u["default"].bind(this,this.initializeDashJS)))}return o(e,[{key:"initializeDashJS",value:function(t,n){var r=this,a={};return n?(this.showErrors(),this.tech_.triggerReady(),void this.dispose()):(e.getWidevineProtectionData&&(a=e.getWidevineProtectionData(t),this.keySystemOptions_=u["default"].mergeOptions(this.keySystemOptions_,a)),void this.resetSrc_(function(){r.showErrors(),r.mediaPlayer_.attachSource(t,null,r.keySystemOptions_),r.tech_.triggerReady()}))}},{key:"hideErrors",value:function(){this.elParent_.className+=" vjs-dashjs-hide-errors"}},{key:"showErrors",value:function(){var e=this;setTimeout(function(){e.elParent_.className=e.elParent_.className.replace(" vjs-dashjs-hide-errors","")},250)}},{key:"resetSrc_",value:function(e){this.el_&&(this.el_.src="",this.el_.setMediaKeys?this.el_.setMediaKeys(null).then(e,e):e())}},{key:"dispose",value:function(){this.mediaPlayer_&&this.mediaPlayer_.reset(),this.resetSrc_(function(){})}}],[{key:"buildDashJSProtData",value:function(e){var t={};if(!e||!Array.isArray(e))return t;for(var n=0;n<e.length;n++){var r=e[n],a=u["default"].mergeOptions({},r.options);a.licenseUrl&&(a.serverURL=a.licenseUrl,delete a.licenseUrl),t[r.name]=a}return t}}]),e}();n["default"]=l,t.exports=n["default"]}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"dashjs/dist/dash.all.debug":3}],3:[function(e,t,n){(function(t){!function n(t,r,a){function i(s,u){if(!r[s]){if(!t[s]){var l="function"==typeof e&&e;if(!u&&l)return l(s,!0);if(o)return o(s,!0);var d=new Error("Cannot find module '"+s+"'");throw d.code="MODULE_NOT_FOUND",d}var f=r[s]={exports:{}};t[s][0].call(f.exports,function(e){var n=t[s][1][e];return i(n?n:e)},f,f.exports,n,t,r,a)}return r[s].exports}for(var o="function"==typeof e&&e,s=0;s<a.length;s++)i(a[s]);return i}({1:[function(e,t,n){"use strict";var r={};r.encode=function(e){for(var t=[],n=0;n<e.length;++n){var r=e.charCodeAt(n);128>r?t.push(r):2048>r?(t.push(192|r>>6),t.push(128|63&r)):65536>r?(t.push(224|r>>12),t.push(128|63&r>>6),t.push(128|63&r)):(t.push(240|r>>18),t.push(128|63&r>>12),t.push(128|63&r>>6),t.push(128|63&r))}return t},r.decode=function(e){for(var t=[],n=0;n<e.length;){var r=e[n++];128>r||(224>r?(r=(31&r)<<6,r|=63&e[n++]):240>r?(r=(15&r)<<12,r|=(63&e[n++])<<6,r|=63&e[n++]):(r=(7&r)<<18,r|=(63&e[n++])<<12,r|=(63&e[n++])<<6,r|=63&e[n++])),t.push(String.fromCharCode(r))}return t.join("")};var i={};if(function(e){var t=function(t){for(var n=0,r=[],a=0|t.length/3;0<a--;){var i=(t[n]<<16)+(t[n+1]<<8)+t[n+2];n+=3,r.push(e.charAt(63&i>>18)),r.push(e.charAt(63&i>>12)),r.push(e.charAt(63&i>>6)),r.push(e.charAt(63&i))}if(2==t.length-n){var i=(t[n]<<16)+(t[n+1]<<8);r.push(e.charAt(63&i>>18)),r.push(e.charAt(63&i>>12)),r.push(e.charAt(63&i>>6)),r.push("=")}else if(1==t.length-n){var i=t[n]<<16;r.push(e.charAt(63&i>>18)),r.push(e.charAt(63&i>>12)),r.push("==")}return r.join("")},n=function(){for(var t=[],n=0;n<e.length;++n)t[e.charCodeAt(n)]=n;return t["=".charCodeAt(0)]=0,t}(),o=function(e){for(var t=0,r=[],a=0|e.length/4;0<a--;){var i=(n[e.charCodeAt(t)]<<18)+(n[e.charCodeAt(t+1)]<<12)+(n[e.charCodeAt(t+2)]<<6)+n[e.charCodeAt(t+3)];r.push(255&i>>16),r.push(255&i>>8),r.push(255&i),t+=4}return r&&("="==e.charAt(t-2)?(r.pop(),r.pop()):"="==e.charAt(t-1)&&r.pop()),r},u={};u.encode=function(e){for(var t=[],n=0;n<e.length;++n)t.push(e.charCodeAt(n));return t},u.decode=function(e){for(var t=0;t<s.length;++t)a[t]=String.fromCharCode(a[t]);return a.join("")},i.decodeArray=function(e){var t=o(e);return new Uint8Array(t)},i.encodeASCII=function(e){var n=u.encode(e);return t(n)},i.decodeASCII=function(e){var t=o(e);return u.decode(t)},i.encode=function(e){var n=r.encode(e);return t(n)},i.decode=function(e){var t=o(e);return r.decode(t)}}("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),void 0===o)var o=i.encode;if(void 0===u)var u=i.decode;"undefined"!=typeof n&&(n.decode=i.decode,n.decodeArray=i.decodeArray)},{}],2:[function(e,t,n){"use strict";!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=15,a=32,i={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},o={17:2,18:4,21:6,22:8,23:10,19:13,20:15},s={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},u={25:2,26:4,29:6,30:8,31:10,27:13,28:15},l=["white","green","blue","cyan","red","yellow","magenta","black","transparent"],d={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)}},f=function(e){for(var t=[],n=0;n<e.length;n++)t.push(e[n].toString(16));return t},c=function(e,t,n,r,a){this.foreground=e||"white",this.underline=t||!1,this.italics=n||!1,this.background=r||"black",this.flash=a||!1};c.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 g=function(e,t,n,r,a,i){this.uchar=e||" ",this.penState=new c(t,n,r,a,i)};g.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 h=function(){this.chars=[];for(var e=0;a>e;e++)this.chars.push(new g);this.pos=0,this.currPenState=new c};h.prototype={equals:function(e){for(var t=!0,n=0;a>n;n++)if(!this.chars[n].equals(e.chars[n])){t=!1;break}return t},copy:function(e){for(var t=0;a>t;t++)this.chars[t].copy(e.chars[t])},isEmpty:function(){for(var e=!0,t=0;a>t;t++)if(!this.chars[t].isEmpty()){e=!1;break}return e},setCursor:function(e){this.pos!==e&&(this.pos=e),this.pos<0?(d.log("ERROR","Negative cursor position "+this.pos),this.pos=0):this.pos>a&&(d.log("ERROR","Too large cursor position "+this.pos),this.pos=a)},moveCursor:function(e){var t=this.pos+e;if(e>1)for(var n=this.pos+1;t+1>n;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);return this.pos>=a?void d.log("ERROR","Cannot insert "+e.toString(16)+" ("+t+") at position "+this.pos+". Skipping it!"):(this.chars[this.pos].setChar(t,this.currPenState),void this.moveCursor(1))},clearFromPos:function(e){var t;for(t=e;a>t;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;a>n;n++){var r=this.chars[n].uchar;" "!==r&&(t=!1),e.push(r)}return t?"":e.join("")},setPenStyles:function(e){this.currPenState.setStyles(e);var t=this.chars[this.pos];t.setPenState(this.currPenState)}};var p=function(){this.rows=[];for(var e=0;r>e;e++)this.rows.push(new h);this.currRow=r-1,this.nrRollUpRows=null,this.reset()};p.prototype={reset:function(){for(var e=0;r>e;e++)this.rows[e].clear();this.currRow=r-1},equals:function(e){for(var t=!0,n=0;r>n;n++)if(!this.rows[n].equals(e.rows[n])){t=!1;break}return t},copy:function(e){for(var t=0;r>t;t++)this.rows[t].copy(e.rows[t])},isEmpty:function(){for(var e=!0,t=0;r>t;t++)if(!this.rows[t].isEmpty()){e=!1;break}return e},backSpace:function(){var e=this.rows[this.currRow];e.backSpace()},clearToEndOfRow:function(){var e=this.rows[this.currRow];e.clearToEndOfRow()},insertChar:function(e){var t=this.rows[this.currRow];t.insertChar(e)},setPen:function(e){var t=this.rows[this.currRow];t.setPenStyles(e)},moveCursor:function(e){var t=this.rows[this.currRow];t.moveCursor(e)},setCursor:function(e){d.log("INFO","setCursor: "+e);var t=this.rows[this.currRow];t.setCursor(e)},setPAC:function(e){d.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,a=Math.max(r-1,0);n.setCursor(e.indent),e.color=n.chars[a].penState.foreground}var i={foreground:e.color,underline:e.underline,italics:e.italics,background:"black",flash:!1};this.setPen(i)},setBkgData:function(e){d.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)return void d.log("DEBUG","roll_up but nrRollUpRows not set yet");d.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),d.log("INFO","Rolling up")},getDisplayText:function(e){e=e||!1;for(var t=[],n="",a=-1,i=0;r>i;i++){var o=this.rows[i].getTextString();o&&(a=i+1,e?t.push("Row "+a+': "'+o+'"'):t.push(o.trim()))}return t.length>0&&(n=e?"["+t.join(" | ")+"]":t.join("\n")),n},getTextAndFormat:function(){return this.rows}};var m=function(e,t){this.chNr=e,this.outputFilter=t,this.mode=null,this.verbose=0,this.displayedMemory=new p,this.nonDisplayedMemory=new p,this.lastOutputScreen=new p,this.currRollUpRow=this.displayedMemory.rows[r-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null};m.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[r-1],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,d.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";d.log("INFO",n+": "+this.writeScreen.getDisplayText(!0)),("MODE_PAINT-ON"===this.mode||"MODE_ROLL-UP"===this.mode)&&(d.log("TEXT","DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())},cc_RCL:function(){d.log("INFO","RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")},cc_BS:function(){d.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(){d.log("INFO","DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()},cc_RU:function(e){d.log("INFO","RU("+e+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(e)},cc_FON:function(){d.log("INFO","FON - Flash On"),this.writeScreen.setPen({flash:!0})},cc_RDC:function(){d.log("INFO","RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")},cc_TR:function(){d.log("INFO","TR"),this.setMode("MODE_TEXT")},cc_RTD:function(){d.log("INFO","RTD"),this.setMode("MODE_TEXT")},cc_EDM:function(){d.log("INFO","EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate()},cc_CR:function(){d.log("CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate()},cc_ENM:function(){d.log("INFO","ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()},cc_EOC:function(){if(d.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,d.log("TEXT","DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate()},cc_TO:function(e){d.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,r=["white","green","blue","cyan","red","yellow","magenta"];t.foreground=r[n]}d.log("INFO","MIDROW: "+JSON.stringify(t)),this.writeScreen.setPen(t)},outputDataUpdate:function(){var e=d.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 v=function(e,t,n){this.field=e||1,this.outputs=[t,n],this.channels=[new m(1,t),new m(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}};v.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,a,i=!1;this.lastTime=e,d.setTime(e);for(var o=0;o<t.length;o+=2)if(r=127&t[o],a=127&t[o+1],0!==r||0!==a){if(d.log("DATA","["+f([t[o],t[o+1]])+"] -> ("+f([r,a])+")"),n=this.parseCmd(r,a),n||(n=this.parseMidrow(r,a)),n||(n=this.parsePAC(r,a)),n||(n=this.parseBackgroundAttributes(r,a)),!n&&(i=this.parseChars(r,a)))if(this.currChNr&&this.currChNr>=0){var s=this.channels[this.currChNr-1];s.insertChars(i)}else d.log("WARNING","No channel found yet. TEXT-MODE?");n?this.dataCounters.cmd+=2:i?this.dataCounters["char"]+=2:(this.dataCounters.other+=2,d.log("WARNING","Couldn't parse cleaned data "+f([r,a])+" orig: "+f([t[o],t[o+1]])))}else this.dataCounters.padding+=2},parseCmd:function(e,t){var n=null,r=(20===e||28===e)&&t>=32&&47>=t,a=(23===e||31===e)&&t>=33&&35>=t;if(!r&&!a)return!1;if(e===this.lastCmdA&&t===this.lastCmdB)return this.lastCmdA=null,this.lastCmdB=null,d.log("DEBUG","Repeated command ("+f([e,t])+") is dropped"),!0;n=20===e||23===e?1:2;var i=this.channels[n-1];return 20===e||28===e?32===t?i.cc_RCL():33===t?i.cc_BS():34===t?i.cc_AOF():35===t?i.cc_AON():36===t?i.cc_DER():37===t?i.cc_RU(2):38===t?i.cc_RU(3):39===t?i.cc_RU(4):40===t?i.cc_FON():41===t?i.cc_RDC():42===t?i.cc_TR():43===t?i.cc_RTD():44===t?i.cc_EDM():45===t?i.cc_CR():46===t?i.cc_ENM():47===t&&i.cc_EOC():i.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)&&t>=32&&47>=t){if(n=17===e?1:2,n!==this.currChNr)return d.log("ERROR","Mismatch channel in midrow parsing"),!1;var r=this.channels[n-1];return r.cc_MIDROW(t),d.log("DEBUG","MIDROW ("+f([e,t])+")"),!0}return!1},parsePAC:function(e,t){var n=null,r=null,a=(e>=17&&23>=e||e>=25&&31>=e)&&t>=64&&127>=t,l=(16===e||24===e)&&t>=64&&95>=t;if(!a&&!l)return!1;if(e===this.lastCmdA&&t===this.lastCmdB)return this.lastCmdA=null,this.lastCmdB=null,!0;n=23>=e?1:2,r=t>=64&&95>=t?1===n?i[e]:s[e]:1===n?o[e]:u[e];var d=this.interpretPAC(r,t),f=this.channels[n-1];return f.setPAC(d),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),13>=n?r.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(n/2)]:15>=n?(r.italics=!0,r.color="white"):r.indent=4*Math.floor((n-16)/2),r},parseChars:function(e,t){var r=null,a=null,i=null;if(e>=25?(r=2,i=e-8):(r=1,i=e),i>=17&&19>=i){var o=t;o=17===i?t+80:18===i?t+112:t+144,d.log("INFO","Special char '"+n(o)+"' in channel "+r),a=[o]}else e>=32&&127>=e&&(a=0===t?[e]:[e,t]);if(a){var s=f(a);d.log("DEBUG","Char codes = "+s.join(",")),this.lastCmdA=null,this.lastCmdB=null}return a},parseBackgroundAttributes:function(e,t){var n,r,a,i,o=(16===e||24===e)&&t>=32&&47>=t,s=(23===e||31===e)&&t>=45&&47>=t;return o||s?(n={},16===e||24===e?(r=Math.floor((t-32)/2),n.background=l[r],t%2===1&&(n.background=n.background+"_semi")):45===t?n.background="transparent":(n.foreground="black",47===t&&(n.underline=!0)),a=24>e?1:2,i=this.channels[a-1],i.setBkgData(n),this.lastCmdA=null,this.lastCmdB=null,!0):!1},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)}};var y=function(e,t,n){for(var r=0,a=t,i=0,o=[],s=function(e,t,n,r){if(4!==e||8>t)return null;var a=n.getUint8(r),i=n.getUint16(r+1),o=n.getUint32(r+3),s=n.getUint8(r+7);return 181==a&&49==i&&1195456820==o&&3==s};t+n>a;){if(r=e.getUint32(a),i=31&e.getUint8(a+4),6===i)for(var u=a+5,l=-1;a+4+r-1>u;){l=0;for(var d=255;255===d;)d=e.getUint8(u),l+=d,u++;var f=0;for(d=255;255===d;)d=e.getUint8(u),f+=d,u++;s(l,f,e,u)&&o.push([u,f]),u+=f}a+=r+4}return o},_=function(e,t){var n=t[0],r=[[],[]];n+=8;var a=31&e.getUint8(n);n+=2;for(var i=0;a>i;i++){var o=e.getUint8(n),s=4&o,u=3&o;n++;var l=e.getUint8(n);n++;var d=e.getUint8(n);n++,s&&(127&l)+(127&d)!==0&&(0===u?(r[0].push(l),r[0].push(d)):1===u&&(r[1].push(l),r[1].push(d)))}return r};e.logger=d,e.PenState=c,e.CaptionScreen=p,e.Cea608Parser=v,e.findCea608Nalus=y,e.extractCea608DataFromRange=_}("undefined"==typeof n?(void 0).cea608parser={}:n)},{}],3:[function(e,t,n){"use strict";function r(e){var t,n,r;for(t=[],r=0,n=e.length;n>r;r+=1)e[r].isRoot?t.push("root"):t.push(e[r].name);var a=function(e,t){var n;if(null!==e&&null!==t)for(n in e)e.hasOwnProperty(n)&&(t.hasOwnProperty(n)||(t[n]=e[n]))},i=function(e,t,n){var r,i,o,s,u;if(null!==e&&0!==e.length)for(r=0,i=e.length;i>r;r+=1)o=e[r],t.hasOwnProperty(o.name)&&(n.hasOwnProperty(o.name)?o.merge&&(s=t[o.name],u=n[o.name],"object"==typeof s&&"object"==typeof u?a(s,u):null!=o.mergeFunction?n[o.name]=o.mergeFunction(s,u):n[o.name]=s+u):n[o.name]=t[o.name])},o=function u(e,t){var n,r,a,o,s,l,d,f=e;if(null!==f.children&&0!==f.children.length)for(n=0,r=f.children.length;r>n;n+=1)if(l=f.children[n],t.hasOwnProperty(l.name))if(l.isArray)for(s=t[l.name+"_asArray"],a=0,o=s.length;o>a;a+=1)d=s[a],i(f.properties,t,d),u(l,d);else d=t[l.name],i(f.properties,t,d),u(l,d)},s=function l(n){var r,a,i,s,u,d,f;if(null===n)return n;if("object"!=typeof n)return n;for(r=0,a=t.length;a>r;r+=1)"root"===t[r]&&(u=e[r],d=n,o(u,d));for(s in n)if(n.hasOwnProperty(s)&&"__children"!=s){if(i=t.indexOf(s),-1!==i)if(u=e[i],u.isArray)for(f=n[s+"_asArray"],r=0,a=f.length;a>r;r+=1)d=f[r],o(u,d);else d=n[s],o(u,d);l(n[s])}return n};return{run:s}}Object.defineProperty(n,"__esModule",{value:!0}),n["default"]=r,t.exports=n["default"]},{}],4:[function(e,t,n){"use strict";function r(e,t,n){function r(e){var t=e.localName;return null==t&&(t=e.baseName),(null==t||""==t)&&(t=e.nodeName),t}function a(e){return e.prefix}function i(e){return"string"==typeof e?e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;").replace(/\//g,"&#x2F;"):e}function o(e){return e.replace(/&amp;/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&#x27;/g,"'").replace(/&#x2F;/g,"/")}function s(i){if(i.nodeType==E.DOCUMENT_NODE){var u,l,d,f=i.firstChild;for(l=0,d=i.childNodes.length;d>l;l+=1)if(i.childNodes[l].nodeType!==E.COMMENT_NODE){f=i.childNodes[l];break}if(n)u=s(f);else{u={};var c=r(f);u[c]=s(f)}return u}if(i.nodeType==E.ELEMENT_NODE){var u=new Object;u.__cnt=0;for(var g=[],h=i.childNodes,p=0;p<h.length;p++){var f=h.item(p),c=r(f);if(u.__cnt++,null==u[c]){var m=s(f);if("#text"!=c||/[^\s]/.test(m)){var v={};v[c]=m,g.push(v)}u[c]=m,u[c+"_asArray"]=new Array(1),u[c+"_asArray"][0]=u[c]}else{if(null!=u[c]&&!(u[c]instanceof Array)){var y=u[c];u[c]=new Array,u[c][0]=y,u[c+"_asArray"]=u[c]}for(var T=0;null!=u[c][T];)T++;var m=s(f);if("#text"!=c||/[^\s]/.test(m)){var v={};v[c]=m,g.push(v)}u[c][T]=m}}u.__children=g;for(var S=0;S<i.attributes.length;S++){var M=i.attributes.item(S);u.__cnt++;for(var R=M.value,C=0,A=e.length;A>C;C++){var I=e[C];I.test.call(this,M)&&(R=I.converter.call(this,M.value))}u[t+M.name]=R}var D=a(i);return null!=D&&""!=D&&(u.__cnt++,u.__prefix=D),1==u.__cnt&&null!=u["#text"]&&(u=u["#text"]),null!=u["#text"]&&(u.__text=u["#text"],_&&(u.__text=o(u.__text)),delete u["#text"],delete u["#text_asArray"]),null!=u["#cdata-section"]&&(u.__cdata=u["#cdata-section"],delete u["#cdata-section"],delete u["#cdata-section_asArray"]),(null!=u.__text||null!=u.__cdata)&&(u.toString=function(){return(null!=this.__text?this.__text:"")+(null!=this.__cdata?this.__cdata:"")}),u}return i.nodeType==E.TEXT_NODE||i.nodeType==E.CDATA_SECTION_NODE?i.nodeValue:i.nodeType==E.COMMENT_NODE?null:void 0}function u(e,t,n,r){var a="<"+(null!=e&&null!=e.__prefix?e.__prefix+":":"")+t;if(null!=n)for(var i=0;i<n.length;i++){var o=n[i],s=e[o];a+=" "+o.substr(1)+"='"+s+"'"}return a+=r?"/>":">"}function l(e,t){return"</"+(null!=e.__prefix?e.__prefix+":":"")+t+">"}function d(e,t){return-1!==e.indexOf(t,e.length-t.length)}function f(e,t){return d(t.toString(),"_asArray")||0==t.toString().indexOf("_")||e[t]instanceof Function?!0:!1}function c(e){var t=0;if(e instanceof Object)for(var n in e)f(e,n)||t++;return t}function g(e){var t=[];if(e instanceof Object)for(var n in e)-1==n.toString().indexOf("__")&&0==n.toString().indexOf("_")&&t.push(n);return t}function h(e){var t="";return null!=e.__cdata&&(t+="<![CDATA["+e.__cdata+"]]>"),null!=e.__text&&(t+=_?i(e.__text):e.__text),t}function p(e){var t="";return e instanceof Object?t+=h(e):null!=e&&(t+=_?i(e):e),t}function m(e,t,n){var r="";if(0==e.length)r+=u(e,t,n,!0);else for(var a=0;a<e.length;a++)r+=u(e[a],t,g(e[a]),!1),r+=v(e[a]),r+=l(e[a],t);return r}function v(e){var t="",n=c(e);if(n>0)for(var r in e)if(!f(e,r)){var a=e[r],i=g(a);if(null==a||void 0==a)t+=u(a,r,i,!0);else if(a instanceof Object)if(a instanceof Array)t+=m(a,r,i);else{var o=c(a);o>0||null!=a.__text||null!=a.__cdata?(t+=u(a,r,i,!1),t+=v(a),t+=l(a,r)):t+=u(a,r,i,!0)}else t+=u(a,r,i,!1),t+=p(a),t+=l(a,r)}return t+=p(e)}(null===t||void 0===t)&&(t="_"),(null===n||void 0===n)&&(n=!1);var y="1.0.11",_=!1,E={ELEMENT_NODE:1,TEXT_NODE:3,CDATA_SECTION_NODE:4,COMMENT_NODE:8,DOCUMENT_NODE:9};this.parseXmlString=function(e){var t,n,r;if(window.DOMParser){n=new window.DOMParser;try{r=n.parseFromString("<","text/xml").getElementsByTagName("parsererror")[0].namespaceURI}catch(a){}try{t=n.parseFromString(e,"text/xml"),r&&t.getElementsByTagNameNS(r,"parsererror").length&&(t=void 0)}catch(a){}}else 0==e.indexOf("<?")&&(e=e.substr(e.indexOf("?>")+2)),t=new ActiveXObject("Microsoft.XMLDOM"),t.async="false",t.loadXML(e);return t},this.xml2json=function(e){return s(e)},this.xml_str2json=function(e){var t=this.parseXmlString(e);return t?this.xml2json(t):void 0},this.json2xml_str=function(e){return v(e)},this.json2xml=function(e){var t=this.json2xml_str(e);return this.parseXmlString(t)},this.getVersion=function(){return y},this.escapeMode=function(e){_=e}}Object.defineProperty(n,"__esModule",{value:!0}),n["default"]=r,t.exports=n["default"]},{}],5:[function(e,n,r){(function(t){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(r,"__esModule",{value:!0});var a=e("./src/streaming/MediaPlayer.js"),i=n(a),o=e("./src/streaming/protection/Protection.js"),s=n(o),u=e("./src/streaming/metrics/MetricsReporting.js"),l=n(u),d=e("./src/streaming/MediaPlayerFactory.js"),f=n(d),c=window||t,g=c.dashjs;g||(g=c.dashjs={}),g.MediaPlayer=i["default"],g.Protection=s["default"],g.MetricsReporting=l["default"],g.MediaPlayerFactory=f["default"],r["default"]=g,r.MediaPlayer=i["default"],r.Protection=s["default"],r.MetricsReporting=l["default"],r.MediaPlayerFactory=f["default"]}).call(this,"undefined"!=typeof t?t:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./src/streaming/MediaPlayer.js":33,"./src/streaming/MediaPlayerFactory.js":35,"./src/streaming/metrics/MetricsReporting.js":55,"./src/streaming/protection/Protection.js":85}],6:[function(e,t,n){var r={};r.parseBuffer=function(e){return new a(e).parse()},r.Utils={},r.Utils.dataViewToString=function(e,t){var n=t||"utf-8";if("undefined"!=typeof TextDecoder)return new TextDecoder(n).decode(e);var r=[],a=0;if("utf-8"===n)for(;a<e.byteLength;){var i=e.getUint8(a++);128>i||(224>i?(i=(31&i)<<6,i|=63&e.getUint8(a++)):240>i?(i=(15&i)<<12,i|=(63&e.getUint8(a++))<<6,i|=63&e.getUint8(a++)):(i=(7&i)<<18,i|=(63&e.getUint8(a++))<<12,i|=(63&e.getUint8(a++))<<6,i|=63&e.getUint8(a++))),r.push(String.fromCharCode(i))}else for(;a<e.byteLength;)r.push(String.fromCharCode(e.getUint8(a++)));return r.join("")},"undefined"!=typeof n&&(n.parseBuffer=r.parseBuffer,n.Utils=r.Utils),r.Cursor=function(e){this.offset="undefined"==typeof e?0:e};var a=function(e){this._raw=new DataView(e),this._cursor=new r.Cursor,this.boxes=[]};a.prototype.fetch=function(e){var t=this.fetchAll(e,!0);return t.length?t[0]:null},a.prototype.fetchAll=function(e,t){var n=[];return a._sweep.call(this,e,n,t),n},a.prototype.parse=function(){for(this._cursor.offset=0,this.boxes=[];this._cursor.offset<this._raw.byteLength;){var e=i.parse(this);if("undefined"==typeof e.type)break;this.boxes.push(e)}return this},a._sweep=function(e,t,n){this.type&&this.type==e&&t.push(this);for(var r in this.boxes){if(t.length&&n)return;a._sweep.call(this.boxes[r],e,t,n)}};var i=function(){this._cursor=new r.Cursor};i.parse=function(e){var t=new i;return t._offset=e._cursor.offset,t._root=e._root?e._root:e,t._raw=e._raw,t._parent=e,t._parseBox(),e._cursor.offset=t._raw.byteOffset+t._raw.byteLength,t},i.prototype._readInt=function(e){var t=null;switch(e){case 8:t=this._raw.getInt8(this._cursor.offset-this._raw.byteOffset);break;case 16:t=this._raw.getInt16(this._cursor.offset-this._raw.byteOffset);break;case 32:t=this._raw.getInt32(this._cursor.offset-this._raw.byteOffset);break;case 64:var n=this._raw.getInt32(this._cursor.offset-this._raw.byteOffset),r=this._raw.getInt32(this._cursor.offset-this._raw.byteOffset+4);t=n*Math.pow(2,32)+r}return this._cursor.offset+=e>>3,t},i.prototype._readUint=function(e){var t=null;switch(e){case 8:t=this._raw.getUint8(this._cursor.offset-this._raw.byteOffset);break;case 16:t=this._raw.getUint16(this._cursor.offset-this._raw.byteOffset);break;case 24:var n=this._raw.getUint16(this._cursor.offset-this._raw.byteOffset),r=this._raw.getUint8(this._cursor.offset-this._raw.byteOffset+2);t=(n<<8)+r;break;case 32:t=this._raw.getUint32(this._cursor.offset-this._raw.byteOffset);break;case 64:var n=this._raw.getUint32(this._cursor.offset-this._raw.byteOffset),r=this._raw.getUint32(this._cursor.offset-this._raw.byteOffset+4);t=n*Math.pow(2,32)+r}return this._cursor.offset+=e>>3,t},i.prototype._readString=function(e){for(var t="",n=0;e>n;n++){var r=this._readUint(8);t+=String.fromCharCode(r)}return t},i.prototype._readTerminatedString=function(){for(var e="";;){var t=this._readUint(8);if(0==t)break;e+=String.fromCharCode(t)}return e},i.prototype._readTemplate=function(e){var t=this._readUint(e/2),n=this._readUint(e/2);return t+n/Math.pow(2,e/2)},i.prototype._parseBox=function(){if(this._cursor.offset=this._offset,this._offset+8>this._raw.buffer.byteLength)return void(this._root._incomplete=!0);switch(this.size=this._readUint(32),this.type=this._readString(4),1==this.size&&(this.largesize=this._readUint(64)), "uuid"==this.type&&(this.usertype=this._readString(16)),this.size){case 0:this._raw=new DataView(this._raw.buffer,this._offset,this._raw.byteLength-this._cursor.offset);break;case 1:this._offset+this.size>this._raw.buffer.byteLength?(this._incomplete=!0,this._root._incomplete=!0):this._raw=new DataView(this._raw.buffer,this._offset,this.largesize);break;default:this._offset+this.size>this._raw.buffer.byteLength?(this._incomplete=!0,this._root._incomplete=!0):this._raw=new DataView(this._raw.buffer,this._offset,this.size)}!this._incomplete&&this._boxParsers[this.type]&&this._boxParsers[this.type].call(this)},i.prototype._parseFullBox=function(){this.version=this._readUint(8),this.flags=this._readUint(24)},i.prototype._boxParsers={},["moov","trak","tref","mdia","minf","stbl","edts","dinf","mvex","moof","traf","mfra","udta","meco","strk","vttc"].forEach(function(e){i.prototype._boxParsers[e]=function(){for(this.boxes=[];this._cursor.offset-this._raw.byteOffset<this._raw.byteLength;)this.boxes.push(i.parse(this))}}),i.prototype._boxParsers.elst=function(){this._parseFullBox(),this.entry_count=this._readUint(32),this.entries=[];for(var e=1;e<=this.entry_count;e++){var t={};1==this.version?(t.segment_duration=this._readUint(64),t.media_time=this._readInt(64)):(t.segment_duration=this._readUint(32),t.media_time=this._readInt(32)),t.media_rate_integer=this._readInt(16),t.media_rate_fraction=this._readInt(16),this.entries.push(t)}},i.prototype._boxParsers.emsg=function(){this._parseFullBox(),this.scheme_id_uri=this._readTerminatedString(),this.value=this._readTerminatedString(),this.timescale=this._readUint(32),this.presentation_time_delta=this._readUint(32),this.event_duration=this._readUint(32),this.id=this._readUint(32),this.message_data=new DataView(this._raw.buffer,this._cursor.offset,this._raw.byteLength-(this._cursor.offset-this._offset))},i.prototype._boxParsers.free=i.prototype._boxParsers.skip=function(){this.data=new DataView(this._raw.buffer,this._cursor.offset,this._raw.byteLength-(this._cursor.offset-this._offset))},i.prototype._boxParsers.ftyp=i.prototype._boxParsers.styp=function(){for(this.major_brand=this._readString(4),this.minor_versions=this._readUint(32),this.compatible_brands=[];this._cursor.offset-this._raw.byteOffset<this._raw.byteLength;)this.compatible_brands.push(this._readString(4))},i.prototype._boxParsers.hdlr=function(){this._parseFullBox(),this.pre_defined=this._readUint(32),this.handler_type=this._readString(4),this.reserved=[this._readUint(32),this._readUint(32),this._readUint(32)],this.name=this._readTerminatedString()},i.prototype._boxParsers.mdat=function(){this.data=new DataView(this._raw.buffer,this._cursor.offset,this._raw.byteLength-(this._cursor.offset-this._offset))},i.prototype._boxParsers.mdhd=function(){this._parseFullBox(),1==this.version?(this.creation_time=this._readUint(64),this.modification_time=this._readUint(64),this.timescale=this._readUint(32),this.duration=this._readUint(64)):(this.creation_time=this._readUint(32),this.modification_time=this._readUint(32),this.timescale=this._readUint(32),this.duration=this._readUint(32));var e=this._readUint(16);this.pad=e>>15,this.language=String.fromCharCode((e>>10&31)+96,(e>>5&31)+96,(31&e)+96),this.pre_defined=this._readUint(16)},i.prototype._boxParsers.mfhd=function(){this._parseFullBox(),this.sequence_number=this._readUint(32)},i.prototype._boxParsers.mvhd=function(){this._parseFullBox(),1==this.version?(this.creation_time=this._readUint(64),this.modification_time=this._readUint(64),this.timescale=this._readUint(32),this.duration=this._readUint(64)):(this.creation_time=this._readUint(32),this.modification_time=this._readUint(32),this.timescale=this._readUint(32),this.duration=this._readUint(32)),this.rate=this._readTemplate(32),this.volume=this._readTemplate(16),this.reserved1=this._readUint(16),this.reserved2=[this._readUint(32),this._readUint(32)],this.matrix=[];for(var e=0;9>e;e++)this.matrix.push(this._readTemplate(32));this.pre_defined=[];for(var e=0;6>e;e++)this.pre_defined.push(this._readUint(32));this.next_track_ID=this._readUint(32)},i.prototype._boxParsers.payl=function(){var e=new DataView(this._raw.buffer,this._cursor.offset,this._raw.byteLength-(this._cursor.offset-this._offset));this.cue_text=r.Utils.dataViewToString(e)},i.prototype._boxParsers.sidx=function(){this._parseFullBox(),this.reference_ID=this._readUint(32),this.timescale=this._readUint(32),0==this.version?(this.earliest_presentation_time=this._readUint(32),this.first_offset=this._readUint(32)):(this.earliest_presentation_time=this._readUint(64),this.first_offset=this._readUint(64)),this.reserved=this._readUint(16),this.reference_count=this._readUint(16),this.references=[];for(var e=0;e<this.reference_count;e++){var t={},n=this._readUint(32);t.reference_type=n>>31&1,t.referenced_size=2147483647&n,t.subsegment_duration=this._readUint(32);var r=this._readUint(32);t.starts_with_SAP=r>>31&1,t.SAP_type=r>>28&7,t.SAP_delta_time=268435455&r,this.references.push(t)}},i.prototype._boxParsers.ssix=function(){this._parseFullBox(),this.subsegment_count=this._readUint(32),this.subsegments=[];for(var e=0;e<this.subsegment_count;e++){var t={};t.ranges_count=this._readUint(32),t.ranges=[];for(var n=0;n<t.ranges_count;n++){var r={};r.level=this._readUint(8),r.range_size=this._readUint(24),t.ranges.push(r)}this.subsegments.push(t)}},i.prototype._boxParsers.tfdt=function(){this._parseFullBox(),1==this.version?this.baseMediaDecodeTime=this._readUint(64):this.baseMediaDecodeTime=this._readUint(32)},i.prototype._boxParsers.tfhd=function(){this._parseFullBox(),this.track_ID=this._readUint(32),1&this.flags&&(this.base_data_offset=this._readUint(64)),2&this.flags&&(this.sample_description_offset=this._readUint(32)),8&this.flags&&(this.default_sample_duration=this._readUint(32)),16&this.flags&&(this.default_sample_size=this._readUint(32)),32&this.flags&&(this.default_sample_flags=this._readUint(32))},i.prototype._boxParsers.tkhd=function(){this._parseFullBox(),1==this.version?(this.creation_time=this._readUint(64),this.modification_time=this._readUint(64),this.track_ID=this._readUint(32),this.reserved1=this._readUint(32),this.duration=this._readUint(64)):(this.creation_time=this._readUint(32),this.modification_time=this._readUint(32),this.track_ID=this._readUint(32),this.reserved1=this._readUint(32),this.duration=this._readUint(32)),this.reserved2=[this._readUint(32),this._readUint(32)],this.layer=this._readUint(16),this.alternate_group=this._readUint(16),this.volume=this._readTemplate(16),this.reserved3=this._readUint(16),this.matrix=[];for(var e=0;9>e;e++)this.matrix.push(this._readTemplate(32));this.width=this._readUint(32),this.height=this._readUint(32)},i.prototype._boxParsers.trun=function(){this._parseFullBox(),this.sample_count=this._readUint(32),1&this.flags&&(this.data_offset=this._readInt(32)),4&this.flags&&(this.first_sample_flags=this._readUint(32)),this.samples=[];for(var e=0;e<this.sample_count;e++){var t={};256&this.flags&&(t.sample_duration=this._readUint(32)),512&this.flags&&(t.sample_size=this._readUint(32)),1024&this.flags&&(t.sample_flags=this._readUint(32)),2048&this.flags&&(0==this.version?t.sample_composition_time_offset=this._readUint(32):t.sample_composition_time_offset=this._readInt(32)),this.samples.push(t)}},i.prototype._boxParsers.vlab=function(){var e=new DataView(this._raw.buffer,this._cursor.offset,this._raw.byteLength-(this._cursor.offset-this._offset));this.source_label=r.Utils.dataViewToString(e)},i.prototype._boxParsers.vttC=function(){var e=new DataView(this._raw.buffer,this._cursor.offset,this._raw.byteLength-(this._cursor.offset-this._offset));this.config=r.Utils.dataViewToString(e)},i.prototype._boxParsers.vtte=function(){}},{}],7:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function a(){function e(){d=!0,f=!0,c=(new Date).getTime()}function t(e){f=e}function n(e){d=e}function r(){return d}function a(){var e="",t=null;f&&(t=(new Date).getTime(),e+="["+(t-c)+"]"),e.length>0&&(e+=" "),Array.apply(null,arguments).forEach(function(t){e+=t+" "}),d&&console.log(e),s.trigger(u["default"].LOG,{message:e})}var i=this.context,s=(0,o["default"])(i).getInstance(),l=void 0,d=void 0,f=void 0,c=void 0;return l={log:a,setLogTimestampVisible:t,setLogToBrowserConsole:n,getLogToBrowserConsole:r},e(),l}Object.defineProperty(n,"__esModule",{value:!0});var i=e("./EventBus.js"),o=r(i),s=e("./events/Events.js"),u=r(s),l=e("./FactoryMaker.js"),d=r(l);a.__dashjs_factory_name="Debug",n["default"]=d["default"].getSingletonFactory(a),t.exports=n["default"]},{"./EventBus.js":8,"./FactoryMaker.js":9,"./events/Events.js":11}],8:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function a(){function e(e,t,n){if(!e)throw new Error("event type cannot be null or undefined");if(!t||"function"!=typeof t)throw new Error("listener must be a function: "+t);if(!(a(e,t,n)>=0)){var r={callback:t,scope:n};o[e]=o[e]||[],o[e].push(r)}}function t(e,t,n){if(e&&t&&o[e]){var r=a(e,t,n);0>r||o[e].splice(r,1)}}function n(e,t){if(e&&o[e]){if(t=t||{},t.hasOwnProperty("type"))throw new Error("'type' is a reserved word for event dispatching");t.type=e,o[e].forEach(function(e){e.callback.call(e.scope,t)})}}function r(){o={}}function a(e,t,n){var r=o[e],a=-1;if(!r||0===r.length)return a;for(var i=0;i<r.length;i++)if(r[i].callback===t&&(!n||n===r[i].scope))return i;return a}var i=void 0,o={};return i={on:e,off:t,trigger:n,reset:r}}Object.defineProperty(n,"__esModule",{value:!0});var i=e("./FactoryMaker.js"),o=r(i);a.__dashjs_factory_name="EventBus",n["default"]=o["default"].getSingletonFactory(a),t.exports=n["default"]},{"./FactoryMaker.js":9}],9:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=function(){function e(e,t,n,r){var a=o(r);!a[e]&&t&&(a[e]={instance:t,override:n})}function t(e,t){for(var n in l){var r=l[n];if(r.context===e&&r.name===t)return r.instance}return null}function n(e,t,n){for(var r in l){var a=l[r];if(a.context===e&&a.name===t)return void(l[r].instance=n)}l.push({name:t,context:e,instance:n})}function r(e){return function(t){return void 0===t&&(t={}),{create:function(){return i(e.__dashjs_factory_name,e.apply({context:t},arguments),t,arguments)}}}}function a(e){return function(n){var r=void 0;return void 0===n&&(n={}),{getInstance:function(){return r||(r=t(n,e.__dashjs_factory_name)),r||(r=i(e.__dashjs_factory_name,e.apply({context:n},arguments),n,arguments),l.push({name:e.__dashjs_factory_name,context:n,instance:r})),r}}}}function i(e,t,n,r){var a=o(n),i=a[e];if(i){var u=i.instance;if(!i.override)return u.apply({context:n,factory:s},r);u=u.apply({context:n,factory:s,parent:t},r);for(var l in u)t.hasOwnProperty(l)&&(t[l]=u[l])}return t}function o(e){var t=void 0;return u.forEach(function(n){n===e&&(t=n)}),t||(t=u.push(e)),t}var s=void 0,u=[],l=[];return s={extend:e,getSingletonInstance:t,setSingletonInstance:n,getSingletonFactory:a,getClassFactory:r}}();n["default"]=r,t.exports=n["default"]},{}],10:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(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)}Object.defineProperty(n,"__esModule",{value:!0});var o=function(e,t,n){for(var r=!0;r;){var a=e,i=t,o=n;r=!1,null===a&&(a=Function.prototype);var s=Object.getOwnPropertyDescriptor(a,i);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var l=Object.getPrototypeOf(a);if(null===l)return;e=l,t=i,n=o,r=!0,s=l=void 0}},s=e("./EventsBase.js"),u=r(s),l=function(e){function t(){a(this,t),o(Object.getPrototypeOf(t.prototype),"constructor",this).call(this),this.AST_IN_FUTURE="astinfuture",this.BUFFERING_COMPLETED="bufferingCompleted",this.BUFFER_CLEARED="bufferCleared",this.BUFFER_LEVEL_STATE_CHANGED="bufferStateChanged",this.BUFFER_LEVEL_UPDATED="bufferLevelUpdated",this.BYTES_APPENDED="bytesAppended",this.CHECK_FOR_EXISTENCE_COMPLETED="checkForExistenceCompleted",this.CHUNK_APPENDED="chunkAppended",this.CURRENT_TRACK_CHANGED="currenttrackchanged",this.DATA_UPDATE_COMPLETED="dataUpdateCompleted",this.DATA_UPDATE_STARTED="dataUpdateStarted",this.FRAGMENT_LOADING_COMPLETED="fragmentLoadingCompleted",this.FRAGMENT_LOADING_STARTED="fragmentLoadingStarted",this.INITIALIZATION_LOADED="initializationLoaded",this.INIT_FRAGMENT_LOADED="initFragmentLoaded",this.INIT_REQUESTED="initRequested",this.INTERNAL_MANIFEST_LOADED="manifestLoaded",this.LIVE_EDGE_SEARCH_COMPLETED="liveEdgeSearchCompleted",this.LOADING_COMPLETED="loadingCompleted",this.LOADING_PROGRESS="loadingProgress",this.MANIFEST_UPDATED="manifestUpdated",this.MEDIA_FRAGMENT_LOADED="mediaFragmentLoaded",this.QUALITY_CHANGED="qualityChanged",this.QUOTA_EXCEEDED="quotaExceeded",this.REPRESENTATION_UPDATED="representationUpdated",this.SEGMENTS_LOADED="segmentsLoaded",this.SOURCEBUFFER_APPEND_COMPLETED="sourceBufferAppendCompleted",this.SOURCEBUFFER_REMOVE_COMPLETED="sourceBufferRemoveCompleted",this.STREAMS_COMPOSED="streamsComposed",this.STREAM_BUFFERING_COMPLETED="streamBufferingCompleted",this.STREAM_COMPLETED="streamCompleted",this.STREAM_INITIALIZED="streaminitialized",this.STREAM_TEARDOWN_COMPLETE="streamTeardownComplete",this.TIMED_TEXT_REQUESTED="timedTextRequested",this.TIME_SYNCHRONIZATION_COMPLETED="timeSynchronizationComplete",this.WALLCLOCK_TIME_UPDATED="wallclockTimeUpdated",this.XLINK_ALL_ELEMENTS_LOADED="xlinkAllElementsLoaded",this.XLINK_ELEMENT_LOADED="xlinkElementLoaded",this.XLINK_READY="xlinkReady"}return i(t,e),t}(u["default"]);n["default"]=l,t.exports=n["default"]},{"./EventsBase.js":12}],11:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(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)}Object.defineProperty(n,"__esModule",{value:!0});var o=function(e,t,n){for(var r=!0;r;){var a=e,i=t,o=n;r=!1,null===a&&(a=Function.prototype);var s=Object.getOwnPropertyDescriptor(a,i);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var l=Object.getPrototypeOf(a);if(null===l)return;e=l,t=i,n=o,r=!0,s=l=void 0}},s=e("./CoreEvents.js"),u=r(s),l=function(e){function t(){a(this,t),o(Object.getPrototypeOf(t.prototype),"constructor",this).apply(this,arguments)}return i(t,e),t}(u["default"]),d=new l;n["default"]=d,t.exports=n["default"]},{"./CoreEvents.js":10}],12:[function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var a=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}}(),i=function(){function e(){r(this,e)}return a(e,[{key:"extend",value:function(e,t){if(e){var n=t?t.override:!1,r=t?t.publicOnly:!1;for(var a in e)!e.hasOwnProperty(a)||this[a]&&!n||r&&-1===e[a].indexOf("public_")||(this[a]=e[a])}}}]),e}();n["default"]=i,t.exports=n["default"]},{}],13:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function a(){function e(e){e&&e.dashManifestModel&&(x=e.dashManifestModel)}function t(){N=[],L={}}function n(e,t){return t.getRepresentationForQuality(e.quality)}function r(e){return L[e.streamInfo.id][e.index]}function a(e){for(var t=N.length,n=0;t>n;n++){var r=N[n];if(e.id===r.id)return r}return null}function i(e,t){var n=new o["default"],r=t.adaptation.period.mpd.manifest.Period_asArray[t.adaptation.period.index].AdaptationSet_asArray[t.adaptation.index],a=x.getRepresentationFor(t.index,r);return n.id=t.id,n.quality=t.index,n.bandwidth=x.getBandwidth(a),n.DVRWindow=t.segmentAvailabilityRange,n.fragmentDuration=t.segmentDuration||(t.segments&&t.segments.length>0?t.segments[0].duration:NaN),n.MSETimeOffset=t.MSETimeOffset,n.useCalculatedLiveEdgeTime=t.useCalculatedLiveEdgeTime,n.mediaInfo=s(e,t.adaptation),n}function s(e,t){var n,r=new u["default"],a=t.period.mpd.manifest.Period_asArray[t.period.index].AdaptationSet_asArray[t.index];return r.id=t.id,r.index=t.index,r.type=t.type,r.streamInfo=f(e,t.period),r.representationCount=x.getRepresentationCount(a),r.lang=x.getLanguageForAdaptation(a),n=x.getViewpointForAdaptation(a),r.viewpoint=n?n.value:void 0,r.accessibility=x.getAccessibilityForAdaptation(a).map(function(e){var t=e.value,n=t;return e.schemeIdUri&&e.schemeIdUri.search("cea-608")>=0&&"undefined"!=typeof y["default"]&&(n=t?"cea-608:"+t:"cea-608",r.embeddedCaptions=!0),n}),r.audioChannelConfiguration=x.getAudioChannelConfigurationForAdaptation(a).map(function(e){return e.value}),r.roles=x.getRolesForAdaptation(a).map(function(e){return e.value}),r.codec=x.getCodec(a),r.mimeType=x.getMimeType(a),r.contentProtection=x.getContentProtectionData(a),r.bitrateList=x.getBitrateListForAdaptation(a),r.contentProtection&&r.contentProtection.forEach(fu