diff --git a/app/assets/javascripts/modules/media_viewer.js b/app/assets/javascripts/modules/media_viewer.js index 10cca26ad..a6a0db1a5 100644 --- a/app/assets/javascripts/modules/media_viewer.js +++ b/app/assets/javascripts/modules/media_viewer.js @@ -1,5 +1,6 @@ //= require modules/thumb_slider /*global ThumbSlider */ +/*global dashjs */ (function( global ) { 'use strict'; @@ -46,9 +47,55 @@ .addThumbnailsToSlider(thumbsForSlider()); } + function loadDashPlayerJavascript(callback) { + var playerJS = jQuery('[data-sul-embed-dash-player]') + .data('sul-embed-dash-player'); + + jQuery.getScript(playerJS).done(callback); + } + + // canPlayType() returns 'probably', 'maybe', or '' + function canPlayHLS() { + var hlsMimeType = 'application/vnd.apple.mpegURL'; + var tempVideo = document.createElement('video'); + var canPlayTypsHLS = tempVideo.canPlayType(hlsMimeType); + return canPlayTypsHLS !== ''; + } + + function removeAllMediaDataSrc() { + jQuery('.sul-embed-media audio, .sul-embed-media video').each(function() { + jQuery(this).removeAttr('data-src'); + }); + } + + function preloadVideoUrls() { + jQuery('.sul-embed-media video').each(function() { + $(this).data('src'); + }); + } + + function initialzeDashPlayerForAllVideos() { + preloadVideoUrls(); + loadDashPlayerJavascript(function() { + jQuery('.sul-embed-media video').each(function() { + var url = jQuery(this).data('src'); + var player = dashjs.MediaPlayer().create(); + player.initialize(this, url, false); + }); + }); + } + return { init: function() { setupThumbSlider(); + this.initialzeDashPlayer(); + }, + + initialzeDashPlayer: function() { + if ( !canPlayHLS() ) { + initialzeDashPlayerForAllVideos(); + } + removeAllMediaDataSrc(); } }; })(); diff --git a/app/assets/javascripts/vendor/dash.js b/app/assets/javascripts/vendor/dash.js new file mode 100644 index 000000000..8fc8cc6e1 --- /dev/null +++ b/app/assets/javascripts/vendor/dash.js @@ -0,0 +1,13 @@ +!function b(a,c,d){function e(g,h){if(!c[g]){if(!a[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};a[g][0].call(k.exports,function(b){var c=a[g][1][b];return e(c?c:b)},k,k.exports,b,a,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;gd?b.push(d):2048>d?(b.push(192|d>>6),b.push(128|63&d)):65536>d?(b.push(224|d>>12),b.push(128|63&d>>6),b.push(128|63&d)):(b.push(240|d>>18),b.push(128|63&d>>12),b.push(128|63&d>>6),b.push(128|63&d))}return b},e.decode=function(a){for(var b=[],c=0;cd||(224>d?(d=(31&d)<<6,d|=63&a[c++]):240>d?(d=(15&d)<<12,d|=(63&a[c++])<<6,d|=63&a[c++]):(d=(7&d)<<18,d|=(63&a[c++])<<12,d|=(63&a[c++])<<6,d|=63&a[c++])),b.push(String.fromCharCode(d))}return b.join("")};var f={};!function(b){var c=function(a){for(var c=0,d=[],e=0|a.length/3;0>18)),d.push(b.charAt(63&f>>12)),d.push(b.charAt(63&f>>6)),d.push(b.charAt(63&f))}if(2==a.length-c){var f=(a[c]<<16)+(a[c+1]<<8);d.push(b.charAt(63&f>>18)),d.push(b.charAt(63&f>>12)),d.push(b.charAt(63&f>>6)),d.push("=")}else if(1==a.length-c){var f=a[c]<<16;d.push(b.charAt(63&f>>18)),d.push(b.charAt(63&f>>12)),d.push("==")}return d.join("")},d=function(){for(var a=[],c=0;c=c&&console.log(this.time+" ["+a+"] "+b)}},l=function(a){for(var b=[],c=0;ca;a++)this.chars.push(new n);this.pos=0,this.currPenState=new m};o.prototype={equals:function(a){for(var b=!0,c=0;e>c;c++)if(!this.chars[c].equals(a.chars[c])){b=!1;break}return b},copy:function(a){for(var b=0;e>b;b++)this.chars[b].copy(a.chars[b])},isEmpty:function(){for(var a=!0,b=0;e>b;b++)if(!this.chars[b].isEmpty()){a=!1;break}return a},setCursor:function(a){this.pos!==a&&(this.pos=a),this.pos<0?(k.log("ERROR","Negative cursor position "+this.pos),this.pos=0):this.pos>e&&(k.log("ERROR","Too large cursor position "+this.pos),this.pos=e)},moveCursor:function(a){var b=this.pos+a;if(a>1)for(var c=this.pos+1;b+1>c;c++)this.chars[c].setPenState(this.currPenState);this.setCursor(b)},backSpace:function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)},insertChar:function(a){a>=144&&this.backSpace();var b=c(a);return this.pos>=e?void k.log("ERROR","Cannot insert "+a.toString(16)+" ("+b+") at position "+this.pos+". Skipping it!"):(this.chars[this.pos].setChar(b,this.currPenState),void this.moveCursor(1))},clearFromPos:function(a){var b;for(b=a;e>b;b++)this.chars[b].reset()},clear:function(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()},clearToEndOfRow:function(){this.clearFromPos(this.pos)},getTextString:function(){for(var a=[],b=!0,c=0;e>c;c++){var d=this.chars[c].uchar;" "!==d&&(b=!1),a.push(d)}return b?"":a.join("")},setPenStyles:function(a){this.currPenState.setStyles(a);var b=this.chars[this.pos];b.setPenState(this.currPenState)}};var p=function(){this.rows=[];for(var a=0;d>a;a++)this.rows.push(new o);this.currRow=d-1,this.nrRollUpRows=null,this.reset()};p.prototype={reset:function(){for(var a=0;d>a;a++)this.rows[a].clear();this.currRow=d-1},equals:function(a){for(var b=!0,c=0;d>c;c++)if(!this.rows[c].equals(a.rows[c])){b=!1;break}return b},copy:function(a){for(var b=0;d>b;b++)this.rows[b].copy(a.rows[b])},isEmpty:function(){for(var a=!0,b=0;d>b;b++)if(!this.rows[b].isEmpty()){a=!1;break}return a},backSpace:function(){var a=this.rows[this.currRow];a.backSpace()},clearToEndOfRow:function(){var a=this.rows[this.currRow];a.clearToEndOfRow()},insertChar:function(a){var b=this.rows[this.currRow];b.insertChar(a)},setPen:function(a){var b=this.rows[this.currRow];b.setPenStyles(a)},moveCursor:function(a){var b=this.rows[this.currRow];b.moveCursor(a)},setCursor:function(a){k.log("INFO","setCursor: "+a);var b=this.rows[this.currRow];b.setCursor(a)},setPAC:function(a){k.log("INFO","pacData = "+JSON.stringify(a));var b=a.row-1;this.nrRollUpRows&&bf;f++){var g=this.rows[f].getTextString();g&&(e=f+1,a?b.push("Row "+e+': "'+g+'"'):b.push(g.trim()))}return b.length>0&&(c=a?"["+b.join(" | ")+"]":b.join("\n")),c},getTextAndFormat:function(){return this.rows}};var q=function(a,b){this.chNr=a,this.outputFilter=b,this.mode=null,this.verbose=0,this.displayedMemory=new p,this.nonDisplayedMemory=new p,this.lastOutputScreen=new p,this.currRollUpRow=this.displayedMemory.rows[d-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null};q.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[d-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.lastCueEndTime=null},getHandler:function(){return this.outputFilter},setHandler:function(a){this.outputFilter=a},setPAC:function(a){this.writeScreen.setPAC(a)},setBkgData:function(a){this.writeScreen.setBkgData(a)},setMode:function(a){a!==this.mode&&(this.mode=a,k.log("INFO","MODE="+a),"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=a)},insertChars:function(a){for(var b=0;b=46,b.italics)b.foreground="white";else{var c=Math.floor(a/2)-16,d=["white","green","blue","cyan","red","yellow","magenta"];b.foreground=d[c]}k.log("INFO","MIDROW: "+JSON.stringify(b)),this.writeScreen.setPen(b)},outputDataUpdate:function(){var a=k.time;null!==a&&this.outputFilter&&(this.outputFilter.updateData&&this.outputFilter.updateData(a,this.displayedMemory),null!==this.cueStartTime||this.displayedMemory.isEmpty()?this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,a,this.lastOutputScreen),this.cueStartTime=this.displayedMemory.isEmpty()?null:a):this.cueStartTime=a,this.lastOutputScreen.copy(this.displayedMemory))},cueSplitAtTime:function(a){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,a,this.displayedMemory),this.cueStartTime=a))}};var r=function(a,b,c){this.field=a||1,this.outputs=[b,c],this.channels=[new q(1,b),new q(2,c)],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}};r.prototype={getHandler:function(a){return this.channels[a].getHandler()},setHandler:function(a,b){this.channels[a].setHandler(b)},addData:function(a,b){var c,d,e,f=!1;this.lastTime=a,k.setTime(a);for(var g=0;g ("+l([d,e])+")"),c=this.parseCmd(d,e),c||(c=this.parseMidrow(d,e)),c||(c=this.parsePAC(d,e)),c||(c=this.parseBackgroundAttributes(d,e)),!c&&(f=this.parseChars(d,e)))if(this.currChNr&&this.currChNr>=0){var h=this.channels[this.currChNr-1];h.insertChars(f)}else k.log("WARNING","No channel found yet. TEXT-MODE?");c?this.dataCounters.cmd+=2:f?this.dataCounters["char"]+=2:(this.dataCounters.other+=2,k.log("WARNING","Couldn't parse cleaned data "+l([d,e])+" orig: "+l([b[g],b[g+1]])))}else this.dataCounters.padding+=2},parseCmd:function(a,b){var c=null,d=(20===a||28===a)&&b>=32&&47>=b,e=(23===a||31===a)&&b>=33&&35>=b;if(!d&&!e)return!1;if(a===this.lastCmdA&&b===this.lastCmdB)return this.lastCmdA=null,this.lastCmdB=null,k.log("DEBUG","Repeated command ("+l([a,b])+") is dropped"),!0;c=20===a||23===a?1:2;var f=this.channels[c-1];return 20===a||28===a?32===b?f.cc_RCL():33===b?f.cc_BS():34===b?f.cc_AOF():35===b?f.cc_AON():36===b?f.cc_DER():37===b?f.cc_RU(2):38===b?f.cc_RU(3):39===b?f.cc_RU(4):40===b?f.cc_FON():41===b?f.cc_RDC():42===b?f.cc_TR():43===b?f.cc_RTD():44===b?f.cc_EDM():45===b?f.cc_CR():46===b?f.cc_ENM():47===b&&f.cc_EOC():f.cc_TO(b-32),this.lastCmdA=a,this.lastCmdB=b,this.currChNr=c,!0},parseMidrow:function(a,b){var c=null;if((17===a||25===a)&&b>=32&&47>=b){if(c=17===a?1:2,c!==this.currChNr)return k.log("ERROR","Mismatch channel in midrow parsing"),!1;var d=this.channels[c-1];return d.cc_MIDROW(b),k.log("DEBUG","MIDROW ("+l([a,b])+")"),!0}return!1},parsePAC:function(a,b){var c=null,d=null,e=(a>=17&&23>=a||a>=25&&31>=a)&&b>=64&&127>=b,j=(16===a||24===a)&&b>=64&&95>=b;if(!e&&!j)return!1;if(a===this.lastCmdA&&b===this.lastCmdB)return this.lastCmdA=null,this.lastCmdB=null,!0;c=23>=a?1:2,d=b>=64&&95>=b?1===c?f[a]:h[a]:1===c?g[a]:i[a];var k=this.interpretPAC(d,b),l=this.channels[c-1];return l.setPAC(k),this.lastCmdA=a,this.lastCmdB=b,this.currChNr=c,!0},interpretPAC:function(a,b){var c=b,d={color:null,italics:!1,indent:null,underline:!1,row:a};return c=b>95?b-96:b-64,d.underline=1===(1&c),13>=c?d.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(c/2)]:15>=c?(d.italics=!0,d.color="white"):d.indent=4*Math.floor((c-16)/2),d},parseChars:function(a,b){var d=null,e=null,f=null;if(a>=25?(d=2,f=a-8):(d=1,f=a),f>=17&&19>=f){var g=b;g=17===f?b+80:18===f?b+112:b+144,k.log("INFO","Special char '"+c(g)+"' in channel "+d),e=[g]}else a>=32&&127>=a&&(e=0===b?[a]:[a,b]);if(e){var h=l(e);k.log("DEBUG","Char codes = "+h.join(",")),this.lastCmdA=null,this.lastCmdB=null}return e},parseBackgroundAttributes:function(a,b){var c,d,e,f,g=(16===a||24===a)&&b>=32&&47>=b,h=(23===a||31===a)&&b>=45&&47>=b;return g||h?(c={},16===a||24===a?(d=Math.floor((b-32)/2),c.background=j[d],b%2===1&&(c.background=c.background+"_semi")):45===b?c.background="transparent":(c.foreground="black",47===b&&(c.underline=!0)),e=24>a?1:2,f=this.channels[e-1],f.setBkgData(c),this.lastCmdA=null,this.lastCmdB=null,!0):!1},reset:function(){for(var a=0;ab)return null;var e=c.getUint8(d),f=c.getUint16(d+1),g=c.getUint32(d+3),h=c.getUint8(d+7);return 181==e&&49==f&&1195456820==g&&3==h};b+c>e;){if(d=a.getUint32(e),f=31&a.getUint8(e+4),6===f)for(var i=e+5,j=-1;e+4+d-1>i;){j=0;for(var k=255;255===k;)k=a.getUint8(i),j+=k,i++;var l=0;for(k=255;255===k;)k=a.getUint8(i),l+=k,i++;h(j,l,a,i)&&g.push([i,l]),i+=l}e+=d+4}return g},t=function(a,b){var c=b[0],d=[[],[]];c+=8;var e=31&a.getUint8(c);c+=2;for(var f=0;e>f;f++){var g=a.getUint8(c),h=4&g,i=3&g;c++;var j=a.getUint8(c);c++;var k=a.getUint8(c);c++,h&&(127&j)+(127&k)!==0&&(0===i?(d[0].push(j),d[0].push(k)):1===i&&(d[1].push(j),d[1].push(k)))}return d};a.logger=k,a.PenState=m,a.CaptionScreen=p,a.Cea608Parser=r,a.findCea608Nalus=s,a.extractCea608DataFromRange=t}("undefined"==typeof c?(void 0).cea608parser={}:c)},{}],3:[function(a,b,c){"use strict";function d(a){var b,c,d;for(b=[],d=0,c=a.length;c>d;d+=1)a[d].isRoot?b.push("root"):b.push(a[d].name);var e=function(a,b){var c;if(null!==a&&null!==b)for(c in a)a.hasOwnProperty(c)&&(b.hasOwnProperty(c)||(b[c]=a[c]))},f=function(a,b,c){var d,f,g,h,i;if(null!==a&&0!==a.length)for(d=0,f=a.length;f>d;d+=1)g=a[d],b.hasOwnProperty(g.name)&&(c.hasOwnProperty(g.name)?g.merge&&(h=b[g.name],i=c[g.name],"object"==typeof h&&"object"==typeof i?e(h,i):null!=g.mergeFunction?c[g.name]=g.mergeFunction(h,i):c[g.name]=h+i):c[g.name]=b[g.name])},g=function i(a,b){var c,d,e,g,h,j,k,l=a;if(null!==l.children&&0!==l.children.length)for(c=0,d=l.children.length;d>c;c+=1)if(j=l.children[c],b.hasOwnProperty(j.name))if(j.isArray)for(h=b[j.name+"_asArray"],e=0,g=h.length;g>e;e+=1)k=h[e],f(l.properties,b,k),i(j,k);else k=b[j.name],f(l.properties,b,k),i(j,k)},h=function j(c){var d,e,f,h,i,k,l;if(null===c)return c;if("object"!=typeof c)return c;for(d=0,e=b.length;e>d;d+=1)"root"===b[d]&&(i=a[d],k=c,g(i,k));for(h in c)if(c.hasOwnProperty(h)&&"__children"!=h){if(f=b.indexOf(h),-1!==f)if(i=a[f],i.isArray)for(l=c[h+"_asArray"],d=0,e=l.length;e>d;d+=1)k=l[d],g(i,k);else k=c[h],g(i,k);j(c[h])}return c};return{run:h}}Object.defineProperty(c,"__esModule",{value:!0}),c["default"]=d,b.exports=c["default"]},{}],4:[function(a,b,c){"use strict";function d(a,b,c){function d(a){var b=a.localName;return null==b&&(b=a.baseName),(null==b||""==b)&&(b=a.nodeName),b}function e(a){return a.prefix}function f(a){return"string"==typeof a?a.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'").replace(/\//g,"/"):a}function g(a){return a.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/'/g,"'").replace(///g,"/")}function h(f){if(f.nodeType==u.DOCUMENT_NODE){var i,j,k,l=f.firstChild;for(j=0,k=f.childNodes.length;k>j;j+=1)if(f.childNodes[j].nodeType!==u.COMMENT_NODE){l=f.childNodes[j];break}if(c)i=h(l);else{i={};var m=d(l);i[m]=h(l)}return i}if(f.nodeType==u.ELEMENT_NODE){var i=new Object;i.__cnt=0;for(var n=[],o=f.childNodes,p=0;pz;z++){var B=a[z];B.test.call(this,x)&&(y=B.converter.call(this,x.value))}i[b+x.name]=y}var C=e(f);return null!=C&&""!=C&&(i.__cnt++,i.__prefix=C),1==i.__cnt&&null!=i["#text"]&&(i=i["#text"]),null!=i["#text"]&&(i.__text=i["#text"],t&&(i.__text=g(i.__text)),delete i["#text"],delete i["#text_asArray"]),null!=i["#cdata-section"]&&(i.__cdata=i["#cdata-section"],delete i["#cdata-section"],delete i["#cdata-section_asArray"]),(null!=i.__text||null!=i.__cdata)&&(i.toString=function(){return(null!=this.__text?this.__text:"")+(null!=this.__cdata?this.__cdata:"")}),i}return f.nodeType==u.TEXT_NODE||f.nodeType==u.CDATA_SECTION_NODE?f.nodeValue:f.nodeType==u.COMMENT_NODE?null:void 0}function i(a,b,c,d){var e="<"+(null!=a&&null!=a.__prefix?a.__prefix+":":"")+b;if(null!=c)for(var f=0;f":">"}function j(a,b){return""}function k(a,b){return-1!==a.indexOf(b,a.length-b.length)}function l(a,b){return k(b.toString(),"_asArray")||0==b.toString().indexOf("_")||a[b]instanceof Function?!0:!1}function m(a){var b=0;if(a instanceof Object)for(var c in a)l(a,c)||b++;return b}function n(a){var b=[];if(a instanceof Object)for(var c in a)-1==c.toString().indexOf("__")&&0==c.toString().indexOf("_")&&b.push(c);return b}function o(a){var b="";return null!=a.__cdata&&(b+=""),null!=a.__text&&(b+=t?f(a.__text):a.__text),b}function p(a){var b="";return a instanceof Object?b+=o(a):null!=a&&(b+=t?f(a):a),b}function q(a,b,c){var d="";if(0==a.length)d+=i(a,b,c,!0);else for(var e=0;e0)for(var d in a)if(!l(a,d)){var e=a[d],f=n(e);if(null==e||void 0==e)b+=i(e,d,f,!0);else if(e instanceof Object)if(e instanceof Array)b+=q(e,d,f);else{var g=m(e);g>0||null!=e.__text||null!=e.__cdata?(b+=i(e,d,f,!1),b+=r(e),b+=j(e,d)):b+=i(e,d,f,!0)}else b+=i(e,d,f,!1),b+=p(e),b+=j(e,d)}return b+=p(a)}(null===b||void 0===b)&&(b="_"),(null===c||void 0===c)&&(c=!1);var s="1.0.11",t=!1,u={ELEMENT_NODE:1,TEXT_NODE:3,CDATA_SECTION_NODE:4,COMMENT_NODE:8,DOCUMENT_NODE:9};this.parseXmlString=function(a){var b,c,d;if(window.DOMParser){c=new window.DOMParser;try{d=c.parseFromString("<","text/xml").getElementsByTagName("parsererror")[0].namespaceURI}catch(e){}try{b=c.parseFromString(a,"text/xml"),d&&b.getElementsByTagNameNS(d,"parsererror").length&&(b=void 0)}catch(e){}}else 0==a.indexOf("")+2)),b=new ActiveXObject("Microsoft.XMLDOM"),b.async="false",b.loadXML(a);return b},this.xml2json=function(a){return h(a)},this.xml_str2json=function(a){var b=this.parseXmlString(a);return b?this.xml2json(b):void 0},this.json2xml_str=function(a){return r(a)},this.json2xml=function(a){var b=this.json2xml_str(a);return this.parseXmlString(b)},this.getVersion=function(){return s},this.escapeMode=function(a){t=a}}Object.defineProperty(c,"__esModule",{value:!0}),c["default"]=d,b.exports=c["default"]},{}],5:[function(a,b,c){(function(b){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}Object.defineProperty(c,"__esModule",{value:!0});var e=a("./src/streaming/MediaPlayer.js"),f=d(e),g=a("./src/streaming/protection/Protection.js"),h=d(g),i=a("./src/streaming/metrics/MetricsReporting.js"),j=d(i),k=a("./src/streaming/MediaPlayerFactory.js"),l=d(k),m=window||b,n=m.dashjs;n||(n=m.dashjs={}),n.MediaPlayer=f["default"],n.Protection=h["default"],n.MetricsReporting=j["default"],n.MediaPlayerFactory=l["default"],c["default"]=n,c.MediaPlayer=f["default"],c.Protection=h["default"],c.MetricsReporting=j["default"],c.MediaPlayerFactory=l["default"]}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./src/streaming/MediaPlayer.js":39,"./src/streaming/MediaPlayerFactory.js":41,"./src/streaming/metrics/MetricsReporting.js":64,"./src/streaming/protection/Protection.js":95}],6:[function(a,b,c){/*! codem-isoboxer v0.2.2 https://github.com/madebyhiro/codem-isoboxer/blob/master/LICENSE.txt */ +var d={};d.parseBuffer=function(a){return new e(a).parse()},d.Utils={},d.Utils.dataViewToString=function(a,b){var c=b||"utf-8";if("undefined"!=typeof TextDecoder)return new TextDecoder(c).decode(a);var d=[],e=0;if("utf-8"===c)for(;ef||(224>f?(f=(31&f)<<6,f|=63&a.getUint8(e++)):240>f?(f=(15&f)<<12,f|=(63&a.getUint8(e++))<<6,f|=63&a.getUint8(e++)):(f=(7&f)<<18,f|=(63&a.getUint8(e++))<<12,f|=(63&a.getUint8(e++))<<6,f|=63&a.getUint8(e++))),d.push(String.fromCharCode(f))}else for(;e>3,b},f.prototype._readUint=function(a){var b=null;switch(a){case 8:b=this._raw.getUint8(this._cursor.offset-this._raw.byteOffset);break;case 16:b=this._raw.getUint16(this._cursor.offset-this._raw.byteOffset);break;case 24:var c=this._raw.getUint16(this._cursor.offset-this._raw.byteOffset),d=this._raw.getUint8(this._cursor.offset-this._raw.byteOffset+2);b=(c<<8)+d;break;case 32:b=this._raw.getUint32(this._cursor.offset-this._raw.byteOffset);break;case 64:var c=this._raw.getUint32(this._cursor.offset-this._raw.byteOffset),d=this._raw.getUint32(this._cursor.offset-this._raw.byteOffset+4);b=c*Math.pow(2,32)+d}return this._cursor.offset+=a>>3,b},f.prototype._readString=function(a){for(var b="",c=0;a>c;c++){var d=this._readUint(8);b+=String.fromCharCode(d)}return b},f.prototype._readTerminatedString=function(){for(var a="";;){var b=this._readUint(8);if(0==b)break;a+=String.fromCharCode(b)}return a},f.prototype._readTemplate=function(a){var b=this._readUint(a/2),c=this._readUint(a/2);return b+c/Math.pow(2,a/2)},f.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)},f.prototype._parseFullBox=function(){this.version=this._readUint(8),this.flags=this._readUint(24)},f.prototype._boxParsers={},["moov","trak","tref","mdia","minf","stbl","edts","dinf","mvex","moof","traf","mfra","udta","meco","strk","vttc"].forEach(function(a){f.prototype._boxParsers[a]=function(){for(this.boxes=[];this._cursor.offset-this._raw.byteOffset>15,this.language=String.fromCharCode((a>>10&31)+96,(a>>5&31)+96,(31&a)+96),this.pre_defined=this._readUint(16)},f.prototype._boxParsers.mfhd=function(){this._parseFullBox(),this.sequence_number=this._readUint(32)},f.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 a=0;9>a;a++)this.matrix.push(this._readTemplate(32));this.pre_defined=[];for(var a=0;6>a;a++)this.pre_defined.push(this._readUint(32));this.next_track_ID=this._readUint(32)},f.prototype._boxParsers.payl=function(){var a=new DataView(this._raw.buffer,this._cursor.offset,this._raw.byteLength-(this._cursor.offset-this._offset));this.cue_text=d.Utils.dataViewToString(a)},f.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 a=0;a>31&1,b.referenced_size=2147483647&c,b.subsegment_duration=this._readUint(32);var d=this._readUint(32);b.starts_with_SAP=d>>31&1,b.SAP_type=d>>28&7,b.SAP_delta_time=268435455&d,this.references.push(b)}},f.prototype._boxParsers.ssix=function(){this._parseFullBox(),this.subsegment_count=this._readUint(32),this.subsegments=[];for(var a=0;aa;a++)this.matrix.push(this._readTemplate(32));this.width=this._readUint(32),this.height=this._readUint(32)},f.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 a=0;a0&&(a+=" "),Array.apply(null,arguments).forEach(function(b){a+=b+" "}),k&&console.log(a),h.trigger(i["default"].LOG,{message:a})}var f=this.context,h=(0,g["default"])(f).getInstance(),j=void 0,k=void 0,l=void 0,m=void 0;return j={log:e,setLogTimestampVisible:b,setLogToBrowserConsole:c,getLogToBrowserConsole:d},a(),j}Object.defineProperty(c,"__esModule",{value:!0});var f=a("./EventBus.js"),g=d(f),h=a("./events/Events.js"),i=d(h),j=a("./FactoryMaker.js"),k=d(j);e.__dashjs_factory_name="Debug",c["default"]=k["default"].getSingletonFactory(e),b.exports=c["default"]},{"./EventBus.js":8,"./FactoryMaker.js":9,"./events/Events.js":11}],8:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(){function a(a,b,c){if(!a)throw new Error("event type cannot be null or undefined");if(!b||"function"!=typeof b)throw new Error("listener must be a function: "+b);if(!(e(a,b,c)>=0)){var d={callback:b,scope:c};g[a]=g[a]||[],g[a].push(d)}}function b(a,b,c){if(a&&b&&g[a]){var d=e(a,b,c);0>d||g[a].splice(d,1)}}function c(a,b){if(a&&g[a]){if(b=b||{},b.hasOwnProperty("type"))throw new Error("'type' is a reserved word for event dispatching");b.type=a,g[a].forEach(function(a){a.callback.call(a.scope,b)})}}function d(){g={}}function e(a,b,c){var d=g[a],e=-1;if(!d||0===d.length)return e;for(var f=0;fc;c++){var d=J[c];if(a.id===d.id)return d}return null}function f(a,b){var c=new g["default"],d=b.adaptation.period.mpd.manifest.Period_asArray[b.adaptation.period.index].AdaptationSet_asArray[b.adaptation.index],e=I.getRepresentationFor(b.index,d);return c.id=b.id,c.quality=b.index,c.bandwidth=I.getBandwidth(e),c.DVRWindow=b.segmentAvailabilityRange,c.fragmentDuration=b.segmentDuration||(b.segments&&b.segments.length>0?b.segments[0].duration:NaN),c.MSETimeOffset=b.MSETimeOffset,c.useCalculatedLiveEdgeTime=b.useCalculatedLiveEdgeTime,c.mediaInfo=h(a,b.adaptation),c}function h(a,b){var c,d=new i["default"],e=b.period.mpd.manifest.Period_asArray[b.period.index].AdaptationSet_asArray[b.index];return d.id=b.id,d.index=b.index,d.type=b.type,d.streamInfo=l(a,b.period),d.representationCount=I.getRepresentationCount(e),d.lang=I.getLanguageForAdaptation(e),c=I.getViewpointForAdaptation(e),d.viewpoint=c?c.value:void 0,d.accessibility=I.getAccessibilityForAdaptation(e).map(function(a){var b=a.value,c=b;return a.schemeIdUri&&a.schemeIdUri.search("cea-608")>=0&&"undefined"!=typeof s["default"]&&(c=b?"cea-608:"+b:"cea-608",d.embeddedCaptions=!0),c}),d.audioChannelConfiguration=I.getAudioChannelConfigurationForAdaptation(e).map(function(a){return a.value}),d.roles=I.getRolesForAdaptation(e).map(function(a){return a.value}),d.codec=I.getCodec(e),d.mimeType=I.getMimeType(e),d.contentProtection=I.getContentProtectionData(e),d.bitrateList=I.getBitrateListForAdaptation(e),d.contentProtection&&d.contentProtection.forEach(function(a){a.KID=I.getKID(a)}),d.isText=I.getIsTextTrack(d.mimeType),d}function j(a,b,c){a.id=b,a.index=100+parseInt(b.substring(2,3)),a.type="embeddedText",a.codec="cea-608-in-SEI",a.isText=!0,a.isEmbedded=!0,a.lang=b+" "+c,a.roles=["caption"]}function l(a,b){var c=new k["default"],d=1;return c.id=b.id,c.index=b.index,c.start=b.start,c.duration=b.duration,c.manifestInfo=n(a,b.mpd),c.isLast=1===a.Period_asArray.length||Math.abs(c.start+c.duration-c.manifestInfo.duration)i;i++){if(d=o[i],g=I.getIndexForAdaptation(d,a,b.index),f=h(a,K[n][g]),"embeddedText"===c){var q=f.accessibility.length;for(k=0;q>k;k++)if(f){var r=f.accessibility[k];if(0===r.indexOf("cea-608:")){var s=r.substring(8),t=s.split(";");if("CC"===t[0].substring(0,2))for(k=0;kd;d++)e.push(l(a,J[d]));return e}function u(a){var b=I.getMpd(a);return n(a,b)}function v(a,b){var c=a.getRepresentationController().getRepresentationForQuality(b);return a.getIndexHandler().getInitRequest(c)}function w(a,b){var d=c(b,a.getRepresentationController());return a.getIndexHandler().getNextSegmentRequest(d)}function x(a,b,d,e){var f=c(b,a.getRepresentationController());return a.getIndexHandler().getSegmentRequestForTime(f,d,e)}function y(a,b,d){var e=c(b,a.getRepresentationController());return a.getIndexHandler().generateSegmentRequestForTime(e,d)}function z(a){return a.getIndexHandler().getCurrentTime()}function A(a,b){return a.getIndexHandler().setCurrentTime(b)}function B(a,b){var c,f,g=e(b.getStreamInfo()),h=b.getMediaInfo(),i=d(h),j=b.getType();c=h.id,f=c?I.getAdaptationForId(c,a,g.index):I.getAdaptationForIndex(h.index,a,g.index),b.getRepresentationController().updateData(f,i,j)}function C(a,b,c){var d=b.getRepresentationForQuality(c);return d?f(a,d):null}function D(a,b){var c=b.getCurrentRepresentation();return c?f(a,c):null}function E(a,b,c){var d=new o["default"],e=a.scheme_id_uri,f=a.value,g=a.timescale,h=a.presentation_time_delta,i=a.event_duration,j=a.id,k=a.message_data,l=c*g+h;return b[e]?(d.eventStream=b[e],d.eventStream.value=f,d.eventStream.timescale=g,d.duration=i,d.id=j,d.presentationTime=l,d.messageData=k,d.presentationTimeDelta=h,d):null}function F(a,b,f){var h=[];return b instanceof k["default"]?h=I.getEventsForPeriod(a,e(b)):b instanceof i["default"]?h=I.getEventStreamForAdaptationSet(a,d(b)):b instanceof g["default"]&&(h=I.getEventStreamForRepresentation(a,c(b,f.getRepresentationController()))),h}function G(){J=[],K={}}var H=void 0,I=void 0,J=void 0,K=void 0;return H={initialize:b,convertDataToTrack:f,convertDataToMedia:h,convertDataToStream:l,getDataForTrack:c,getDataForMedia:d,getDataForStream:e,getStreamsInfo:r,getManifestInfo:u,getMediaInfoForType:p,getAllMediaInfoForType:q,getCurrentRepresentationInfo:D,getRepresentationInfoForQuality:C,updateData:B,getInitRequest:v,getNextFragmentRequest:w,getFragmentRequestForTime:x,generateFragmentRequestForTime:y,getIndexHandlerTime:z,setIndexHandlerTime:A,getEventsFor:F,getEvent:E,setConfig:a,reset:G,metricsList:t}}Object.defineProperty(c,"__esModule",{value:!0});var f=a("../streaming/vo/TrackInfo.js"),g=d(f),h=a("../streaming/vo/MediaInfo.js"),i=d(h),j=a("../streaming/vo/StreamInfo.js"),k=d(j),l=a("../streaming/vo/ManifestInfo.js"),m=d(l),n=a("./vo/Event.js"),o=d(n),p=a("../core/FactoryMaker.js"),q=d(p),r=a("../../externals/cea608-parser.js"),s=d(r),t={TCP_CONNECTION:"TcpList",HTTP_REQUEST:"HttpList",TRACK_SWITCH:"RepSwitchList",BUFFER_LEVEL:"BufferLevel",BUFFER_STATE:"BufferState",DVR_INFO:"DVRInfo",DROPPED_FRAMES:"DroppedFrames",SCHEDULING_INFO:"SchedulingInfo",REQUESTS_QUEUE:"RequestsQueue",MANIFEST_UPDATE:"ManifestUpdate",MANIFEST_UPDATE_STREAM_INFO:"ManifestUpdatePeriodInfo",MANIFEST_UPDATE_TRACK_INFO:"ManifestUpdateRepresentationInfo",PLAY_LIST:"PlayList",DVB_ERRORS:"DVBErrors"};e.__dashjs_factory_name="DashAdapter",c["default"]=q["default"].getSingletonFactory(e),b.exports=c["default"]},{"../../externals/cea608-parser.js":2,"../core/FactoryMaker.js":9,"../streaming/vo/ManifestInfo.js":153,"../streaming/vo/MediaInfo.js":154,"../streaming/vo/StreamInfo.js":156,"../streaming/vo/TrackInfo.js":159,"./vo/Event.js":29}],14:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a){function b(){U=-1,Y=0,Z=NaN,M.on(m["default"].INITIALIZATION_LOADED,I,T),M.on(m["default"].SEGMENTS_LOADED,J,T)}function c(b){$=b,X=$.getType(),W=$.isDynamic(),_=(0,x["default"])(K).create(a,W)}function d(){return $}function e(a){Y=a}function f(){return Y}function h(){return U}function j(){return Z}function l(){_=null,Y=0,Z=NaN,V=NaN,U=-1,W=null,X=null,$=null,M.off(m["default"].INITIALIZATION_LOADED,I,T),M.off(m["default"].SEGMENTS_LOADED,J,T)}function n(a){return a.split("$$").join("$")}function p(a,b){if(null===b||-1===a.indexOf("$RepresentationID$"))return a;var c=b.toString();return a.split("$RepresentationID$").join(c)}function q(a,b,c){var d,e,f=S.resolve(c.path);return f&&b!==f.url&&N.isRelative(b)?(d=f.url,e=f.serviceLocation,b&&(d+=b)):d=b,N.isRelative(d)?!1:(a.url=d,a.serviceLocation=e,!0)}function r(a,b){var c,d,e=new g["default"];return c=a.adaptation.period,e.mediaType=b,e.type=k["default"].INIT_SEGMENT_TYPE,e.range=a.range,d=c.start,e.availabilityStartTime=P.calcAvailabilityStartTimeFromPresentationTime(d,a.adaptation.period.mpd,W),e.availabilityEndTime=P.calcAvailabilityEndTimeFromPresentationTime(d+c.duration,c.mpd,W),e.quality=a.index,e.mediaInfo=$.getMediaInfo(),q(e,a.initialization,a)?e:void 0}function t(a){var b;return a?b=r(a,X):null}function w(a){var b,c,d,e=a.adaptation.period,f=a.segmentInfoType,g=!1;return 0>U?g=!1:W||U=b)):g=!0,g}function z(a){return _.getSegments(a,V,U,A)}function A(a,b){if(a.segments=b,b&&b.length>0&&(Z=isNaN(Z)?b[0].presentationStartTime:Math.min(b[0].presentationStartTime,Z)),W&&isNaN(P.getExpectedLiveEdge())){var c=b.length-1,d=b[c],e=d.presentationStartTime,f=R.getMetricsFor("stream");P.setExpectedLiveEdge(e),R.updateManifestUpdateInfo(Q.getCurrentManifestUpdate(f),{presentationStartTime:e})}}function B(a){if(!a)throw new i["default"]("no representation");return a.segments=null,z(a),a}function C(a,b){var c,d=a.initialization,e="BaseURL"!==a.segmentInfoType&&"SegmentBase"!==a.segmentInfoType;return a.segmentDuration||a.segments||B(a),a.segmentAvailabilityRange=null,a.segmentAvailabilityRange=P.calcSegmentAvailabilityRange(a,W),a.segmentAvailabilityRange.end0)for(h=0;j>h;h++)if(e=i[h],f=e.presentationStartTime,g=e.duration,d=void 0===c||null===c?g/2:c,a+d>=f&&f+g>a-d){k=e.availabilityIdx;break}return k}function E(a){if(null===a||void 0===a)return null;var b=new g["default"],c=a.representation,d=c.adaptation.period.mpd.manifest.Period_asArray[c.adaptation.period.index].AdaptationSet_asArray[c.adaptation.index].Representation_asArray[c.index].bandwidth,e=a.media;return e=(0,v.replaceTokenForTemplate)(e,"Number",a.replacementNumber),e=(0,v.replaceTokenForTemplate)(e,"Time",a.replacementTime),e=(0,v.replaceTokenForTemplate)(e,"Bandwidth",d),e=p(e,c.id),e=n(e),b.mediaType=X,b.type=k["default"].MEDIA_SEGMENT_TYPE,b.range=a.mediaRange,b.startTime=a.presentationStartTime,b.duration=a.duration,b.timescale=c.timescale,b.availabilityStartTime=a.availabilityStartTime,b.availabilityEndTime=a.availabilityEndTime,b.wallStartTime=a.wallStartTime,b.quality=c.index,b.index=a.availabilityIdx,b.mediaInfo=$.getMediaInfo(),b.adaptationIndex=c.adaptation.index,q(b,e,c)?b:void 0}function F(a,b,c){var d,e,f,h=U,i=c?c.keepIdx:!1,j=c?c.timeThreshold:null,k=c&&c.ignoreIsFinished?!0:!1;return a?(V!==b&&(V=b,L("Getting the request for "+X+" time : "+b)),U=D(b,a,j),z(a),0>U&&(U=D(b,a,j)),U>0&&L("Index for "+X+" time "+b+" is "+U),f=k?!1:w(a),f?(d=new g["default"],d.action=g["default"].ACTION_COMPLETE,d.index=U,d.mediaType=X,d.mediaInfo=$.getMediaInfo(),L("Signal complete.",d)):(e=(0,v.getSegmentByIndex)(U,a),d=E(e)),i&&h>=0&&(U="SegmentTimeline"===a.segmentInfoType&&W?U:h),d):null}function G(a,b){var c=(a.segmentAvailabilityRange.end-a.segmentAvailabilityRange.start)/2;return a.segments=null,a.segmentAvailabilityRange={start:b-c,end:b+c},F(a,b,{keepIdx:!1,ignoreIsFinished:!0})}function H(a){var b,c,d;return a&&-1!==U?(V=null,U++,L("Getting the next request at index: "+U),d=w(a),d?(b=new g["default"],b.action=g["default"].ACTION_COMPLETE,b.index=U,b.mediaType=X,b.mediaInfo=$.getMediaInfo(),L("Signal complete.")):(z(a),c=(0,v.getSegmentByIndex)(U,a),b=E(c),!c&&W&&U--),b):null}function I(a){var b=a.representation;b.segments&&M.trigger(m["default"].REPRESENTATION_UPDATED,{sender:this,representation:b})}function J(a){if(!a.error&&X===a.mediaType){var b,c,d,e,f=a.segments,g=a.representation,h=[],i=0;for(b=0,c=f.length;c>b;b++)d=f[b],e=(0,v.getTimeBasedSegment)(P,W,g,d.startTime,d.duration,d.timescale,d.media,d.mediaRange,i),h.push(e),e=null,i++;g.segmentAvailabilityRange={start:h[0].presentationStartTime,end:h[c-1].presentationStartTime},g.availableSegmentsNumber=c,A(g,h),g.initialization&&M.trigger(m["default"].REPRESENTATION_UPDATED,{sender:this,representation:g +})}}var K=this.context,L=(0,s["default"])(K).getInstance().log,M=(0,o["default"])(K).getInstance(),N=(0,u["default"])(K).getInstance(),O=a.segmentBaseLoader,P=a.timelineConverter,Q=a.dashMetrics,R=a.metricsModel,S=a.baseURLController,T=void 0,U=void 0,V=void 0,W=void 0,X=void 0,Y=void 0,Z=void 0,$=void 0,_=void 0;return T={initialize:c,getStreamProcessor:d,getInitRequest:t,getSegmentRequestForTime:F,getNextSegmentRequest:H,generateSegmentRequestForTime:G,updateRepresentation:C,setCurrentTime:e,getCurrentTime:f,getCurrentIndex:h,getEarliestTime:j,reset:l},b(),T}Object.defineProperty(c,"__esModule",{value:!0});var f=a("../streaming/vo/FragmentRequest.js"),g=d(f),h=a("../streaming/vo/Error.js"),i=d(h),j=a("../streaming/vo/metrics/HTTPRequest.js"),k=d(j),l=a("../core/events/Events.js"),m=d(l),n=a("../core/EventBus.js"),o=d(n),p=a("../core/FactoryMaker.js"),q=d(p),r=a("../core/Debug.js"),s=d(r),t=a("../streaming/utils/URLUtils.js"),u=d(t),v=a("./utils/SegmentsUtils.js"),w=a("./utils/SegmentsGetter.js"),x=d(w),y=1;e.__dashjs_factory_name="DashHandler";var z=q["default"].getClassFactory(e);z.SEGMENTS_UNAVAILABLE_ERROR_CODE=y,c["default"]=z,b.exports=c["default"]},{"../core/Debug.js":7,"../core/EventBus.js":8,"../core/FactoryMaker.js":9,"../core/events/Events.js":11,"../streaming/utils/URLUtils.js":145,"../streaming/vo/Error.js":149,"../streaming/vo/FragmentRequest.js":150,"../streaming/vo/metrics/HTTPRequest.js":166,"./utils/SegmentsGetter.js":22,"./utils/SegmentsUtils.js":23}],15:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(){function a(a,b){var c,d=B.getValue(),e=d.Period_asArray[b];return c=w(e,a),null===c?null:c.bandwidth}function b(a,b){var c,d=B.getValue(),e=d.Period_asArray[b];return c=v(e,a)}function c(a,b){var c,d=B.getValue(),e=d.Period_asArray[b];return c=y(e,a)}function d(a,b){var c=0,d=(0,i["default"])(A).getInstance();return d&&(c=d.getTopQualityIndexFor(a,b)),c}function e(a){if(null===a)return null;var b,c,d,e=a.RepSwitchList;return null===e||e.length<=0?null:(b=e.length,c=b-1,d=e[c])}function f(a){if(null===a)return null;var b=a.BufferLevel;return null===b||b.length<=0?null:b[b.length-1]}function h(a){if(null===a)return 0;var b=a.BufferLevel;return null===b||b.length<=0?0:b[b.length-1].level/1e3}function j(a){return a.RequestsQueue}function l(a){if(null===a)return null;var b,c,d=a.HttpList,e=null;if(null===d||d.length<=0)return null;for(b=d.length,c=b-1;c>=0;){if(d[c].responsecode){e=d[c];break}c--}return e}function n(a){return null===a?[]:a.HttpList?a.HttpList:[]}function o(a){if(null===a)return null;var b,c,d,e=a.DroppedFrames;return null===e||e.length<=0?null:(b=e.length,c=b-1,d=e[c])}function p(a){if(null===a)return null;var b,c,d,e=a.SchedulingInfo;return null===e||e.length<=0?null:(b=e.length,c=b-1,d=e[c])}function q(a){if(null===a)return null;var b,c,d,e=a.ManifestUpdate;return null===e||e.length<=0?null:(b=e.length,c=b-1,d=e[c])}function r(a){if(null===a)return null;var b,c,d=a.DVRInfo;return null===d||d.length<=0?null:(b=d.length-1,c=d[b])}function s(a,b){var c,d,e,f={};if(null===a)return null;for(c=n(a),e=c.length-1;e>=0;e--)if(d=c[e],d.type===g["default"].MPD_TYPE){f=u(d._responseHeaders);break}return void 0===f[b]?null:f[b]}function t(a,b){if(null===a)return null;var c,d=l(a);return null===d||null===d._responseHeaders?null:(c=u(d._responseHeaders),void 0===c[b]?null:c[b])}function u(a){var b={};if(!a)return b;for(var c=a.split("\r\n"),d=0,e=c.length;e>d;d++){var f=c[d],g=f.indexOf(": ");g>0&&(b[f.substring(0,g)]=f.substring(g+2))}return b}function v(a,b){var c,d,e,f,g,h;for(d=a.AdaptationSet_asArray,g=0;gd;d++)if(a.nodeName===b[d])return t.test(a.value);return!1},converter:function(a){var b=t.exec(a),c=parseFloat(b[2]||0)*f+parseFloat(b[4]||0)*h+parseFloat(b[6]||0)*i+parseFloat(b[8]||0)*j+parseFloat(b[10]||0)*l+parseFloat(b[12]||0);return void 0!==b[1]&&(c=-c),c}},{type:"datetime",test:function(a){return u.test(a.value)},converter:function(a){var b,c=u.exec(a);if(b=Date.UTC(parseInt(c[1],10),parseInt(c[2],10)-1,parseInt(c[3],10),parseInt(c[4],10),parseInt(c[5],10),c[6]&&parseInt(c[6],10)||0,c[7]&&parseFloat(c[7])*p||0),c[9]&&c[10]){var d=parseInt(c[9],10)*n+parseInt(c[10],10);b+=("+"===c[8]?-1:1)*d*l*p}return new Date(b)}},{type:"numeric",test:function(a){return v.test(a.value)},converter:function(a){return parseFloat(a)}}]}function b(){var a,b,c,d;return d=[{name:"profiles",merge:!1},{name:"width",merge:!1},{name:"height",merge:!1},{name:"sar",merge:!1},{name:"frameRate",merge:!1},{name:"audioSamplingRate",merge:!1},{name:"mimeType",merge:!1},{name:"segmentProfiles",merge:!1},{name:"codecs",merge:!1},{name:"maximumSAPPeriod",merge:!1},{name:"startsWithSap",merge:!1},{name:"maxPlayoutRate",merge:!1},{name:"codingDependency",merge:!1},{name:"scanType",merge:!1},{name:"FramePacking",merge:!0},{name:"AudioChannelConfiguration",merge:!0},{name:"ContentProtection",merge:!0}],a={},a.name="AdaptationSet",a.isRoot=!1,a.isArray=!0,a.parent=null,a.children=[],a.properties=d,b={},b.name="Representation",b.isRoot=!1,b.isArray=!0,b.parent=a,b.children=[],b.properties=d,a.children.push(b),c={},c.name="SubRepresentation",c.isRoot=!1,c.isArray=!0,c.parent=b,c.children=[],c.properties=d,b.children.push(c),a}function c(){var a,b,c,d;return d=[{name:"SegmentBase",merge:!0},{name:"SegmentTemplate",merge:!0},{name:"SegmentList",merge:!0}],a={},a.name="Period",a.isRoot=!1,a.isArray=!0,a.parent=null,a.children=[],a.properties=d,b={},b.name="AdaptationSet",b.isRoot=!1,b.isArray=!0,b.parent=a,b.children=[],b.properties=d,a.children.push(b),c={},c.name="Representation",c.isRoot=!1,c.isArray=!0,c.parent=b,c.children=[],c.properties=d,b.children.push(c),a}function d(){var a=[];return a.push(b()),a.push(c()),a}function e(a,b){var c,e=new o["default"](y,"",!0),f=new m["default"](d()),h=new Date,i=null,j=null;try{if(c=e.xml_str2json(a),!c)throw"parser error";i=new Date,c.hasOwnProperty("Location")&&(c.Location=c.Location_asArray[0]),f.run(c),j=new Date,b.setMatchers(y),b.setIron(f),r("Parsing complete: ( xml2json: "+(i.getTime()-h.getTime())+"ms, objectiron: "+(j.getTime()-i.getTime())+"ms, total: "+(j.getTime()-h.getTime())/1e3+"s)")}catch(k){return(0,g["default"])(q).getInstance().manifestError("parsing the manifest failed","parse",a),null}return c}var f=31536e3,h=2592e3,i=86400,j=3600,l=60,n=60,p=1e3,q=this.context,r=(0,k["default"])(q).getInstance().log,s=void 0,t=void 0,u=void 0,v=void 0,w=void 0,x=void 0,y=void 0;return s={parse:e},a(),s}Object.defineProperty(c,"__esModule",{value:!0});var f=a("../streaming/utils/ErrorHandler.js"),g=d(f),h=a("../core/FactoryMaker.js"),i=d(h),j=a("../core/Debug.js"),k=d(j),l=a("../../externals/objectiron.js"),m=d(l),n=a("../../externals/xml2json.js"),o=d(n);e.__dashjs_factory_name="DashParser",c["default"]=i["default"].getClassFactory(e),b.exports=c["default"]},{"../../externals/objectiron.js":3,"../../externals/xml2json.js":4,"../core/Debug.js":7,"../core/FactoryMaker.js":9,"../streaming/utils/ErrorHandler.js":139}],17:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(){function a(){u=(0,m["default"])(n).getInstance(),v=(0,s["default"])(n).getInstance(),x=(0,g["default"])(n).getInstance()}function b(a){a.baseURLController&&(y=a.baseURLController)}function c(a,b){var d=!0,e=null,f=null,g=new XMLHttpRequest,i=y.resolve(a.path),k=b||{url:i?i.url:void 0,range:{start:0,end:1500},searching:!1,bytesLoaded:0,bytesToLoad:1500,request:g};p("Start searching for initialization."),g.onload=function(){g.status<200||g.status>299||(d=!1,k.bytesLoaded=k.range.end,f=v.parse(g.response),e=h(f),e?(a.range=e,a.initialization=k.url,r.trigger(o["default"].INITIALIZATION_LOADED,{representation:a})):(k.range.end=k.bytesLoaded+k.bytesToLoad,c(a,k)))},g.onloadend=g.onerror=function(){d&&(d=!1,u.downloadError("initialization",k.url,g),r.trigger(o["default"].INITIALIZATION_LOADED,{representation:a}))},j(g,k),p("Perform init search: "+k.url)}function d(a,b,c,e,g){if(c&&(void 0===c.start||void 0===c.end)){var h=c?c.toString().split("-"):null;c=h?{start:parseFloat(h[0]),end:parseFloat(h[1])}:null}g=g?g:l;var i=!0,k=null,m=null,n=!!c,o=new XMLHttpRequest,q=y.resolve(a.path),r={url:q?q.url:void 0,range:n?c:{start:0,end:1500},searching:!n,bytesLoaded:e?e.bytesLoaded:0,bytesToLoad:1500,request:o};o.onload=function(){if(!(o.status<200||o.status>299)){var c=r.bytesToLoad,e=o.response.byteLength;if(i=!1,r.bytesLoaded=r.range.end-r.range.start,k=v.parse(o.response),m=k.getBox("sidx"),m&&m.isComplete){var h,j,l=m.references;if(null!==l&&void 0!==l&&l.length>0&&(h=1===l[0].reference_type),h){p("Initiate multiple SIDX load."),r.range.end=r.range.start+m.size;var n,q,s,t,u,w=[],x=0,y=(m.offset||r.range.start)+m.size,z=function(c){c?(w=w.concat(c),x++,x>=q&&g(w,a,b)):g(null,a,b)};for(n=0,q=l.length;q>n;n++)s=y,t=y+l[n].referenced_size-1,y+=l[n].referenced_size,u={start:s,end:t},d(a,null,u,r,z)}else p("Parsing segments from SIDX."),j=f(m,r),g(j,a,b)}else{if(m)r.range.start=m.offset||r.range.start,r.range.end=r.range.start+(m.size||c);else{if(en;n++)e=g[n].subsegment_duration,f=g[n].referenced_size,c=new i["default"],c.duration=e,c.media=b.url,c.startTime=k,c.timescale=j,d=l+f-1,c.mediaRange=l+"-"+d,m.push(c),k+=e,l+=f;return m}function h(a){var b,c,d=a.getBox("ftyp"),e=a.getBox("moov"),f=null;return p("Searching for initialization."),e&&e.isComplete&&(b=d?d.offset:e.offset,c=e.offset+e.size-1,f=b+"-"+c,p("Found the initialization. Range: "+f)),f}function j(a,b){b.url&&(a.open("GET",x.modifyRequestURL(b.url)),a.responseType="arraybuffer",a.setRequestHeader("Range","bytes="+b.range.start+"-"+b.range.end),a=x.modifyRequestHeader(a),a.send(null))}function l(a,b,c){a?r.trigger(o["default"].SEGMENTS_LOADED,{segments:a,representation:b,mediaType:c}):r.trigger(o["default"].SEGMENTS_LOADED,{segments:null,representation:b,mediaType:c,error:new k["default"](null,"error loading segments",null)})}var n=this.context,p=(0,w["default"])(n).getInstance().log,r=(0,q["default"])(n).getInstance(),t=void 0,u=void 0,v=void 0,x=void 0,y=void 0;return t={setConfig:b,initialize:a,loadInitialization:c,loadSegments:d,reset:e}}Object.defineProperty(c,"__esModule",{value:!0});var f=a("../streaming/utils/RequestModifier.js"),g=d(f),h=a("./vo/Segment.js"),i=d(h),j=a("../streaming/vo/Error.js"),k=d(j),l=a("../streaming/utils/ErrorHandler.js"),m=d(l),n=a("../core/events/Events.js"),o=d(n),p=a("../core/EventBus.js"),q=d(p),r=a("../streaming/utils/BoxParser.js"),s=d(r),t=a("../core/FactoryMaker.js"),u=d(t),v=a("../core/Debug.js"),w=d(v);e.__dashjs_factory_name="SegmentBaseLoader",c["default"]=u["default"].getSingletonFactory(e),b.exports=c["default"]},{"../core/Debug.js":7,"../core/EventBus.js":8,"../core/FactoryMaker.js":9,"../core/events/Events.js":11,"../streaming/utils/BoxParser.js":135,"../streaming/utils/ErrorHandler.js":139,"../streaming/utils/RequestModifier.js":143,"../streaming/vo/Error.js":149,"./vo/Segment.js":34}],18:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(){function a(){P=null,Q=-1,R=!0,S=[],V=(0,m["default"])(M).getInstance(),X=(0,q["default"])(M).getInstance(),Y=(0,o["default"])(M).getInstance(),Z=(0,s["default"])(M).getInstance(),$=(0,u["default"])(M).getInstance(),_=(0,y["default"])(M).getInstance(),aa=(0,k["default"])(M).getInstance(),ba=(0,g["default"])(M).getInstance(),ca=(0,i["default"])(M).getInstance(),da=(0,w["default"])(M).getInstance(),N.on(E["default"].QUALITY_CHANGED,K,O),N.on(E["default"].REPRESENTATION_UPDATED,G,O),N.on(E["default"].WALLCLOCK_TIME_UPDATED,H,O),N.on(E["default"].BUFFER_LEVEL_UPDATED,J,O),N.on(E["default"].LIVE_EDGE_SEARCH_COMPLETED,I,O)}function b(a){a.abrController&&(V=a.abrController)}function c(a){U=a,W=U.getIndexHandler()}function d(){return U}function e(){return P}function f(){return Q}function h(){return R}function j(){return T}function l(){N.off(E["default"].QUALITY_CHANGED,K,O),N.off(E["default"].REPRESENTATION_UPDATED,G,O),N.off(E["default"].WALLCLOCK_TIME_UPDATED,H,O),N.off(E["default"].BUFFER_LEVEL_UPDATED,J,O),N.off(E["default"].LIVE_EDGE_SEARCH_COMPLETED,I,O),P=null,Q=-1,R=!0,S=[],V=null,X=null,Y=null,Z=null,$=null,_=null,aa=null,ba=null,ca=null,da=null}function n(a,b,c){var d,e,f=null,g=U.getStreamInfo(),h=V.getTopQualityIndexFor(c,g.id);if(R=!0,N.trigger(E["default"].DATA_UPDATE_STARTED,{sender:this}),S=z(b),null===P&&"fragmentedText"!==c?(e=V.getAverageThroughput(c),f=e||V.getInitialBitrateFor(c,g),d=V.getQualityForBitrate(U.getMediaInfo(),f)):d=V.getQualityFor(c,g),d>h&&(d=h),T=t(d),P=a,"video"!==c&&"audio"!==c&&"fragmentedText"!==c)return R=!1,void N.trigger(E["default"].DATA_UPDATE_COMPLETED,{sender:this,data:P,currentRepresentation:T});for(var i=0;ia;a++){var c=S[a].segmentInfoType;if(null===S[a].segmentAvailabilityRange||null===S[a].initialization||("SegmentBase"===c||"BaseURL"===c)&&!S[a].segments)return!1}return!0}function z(a){var b,c=Z.getValue();return Q=ba.getIndexForAdaptation(P,c,a.period.index),b=ba.getRepresentationsForAdaptation(c,a)}function B(a){for(var b,c=0,d=S.length;d>c;c++)b=S[c],b.segmentAvailabilityRange=aa.calcSegmentAvailabilityRange(b,a)}function D(){S.forEach(function(a){a.segmentAvailabilityRange=null})}function F(a){var b=a,c=function(){if(!h()){R=!0,N.trigger(E["default"].DATA_UPDATE_STARTED,{sender:O}),D();for(var a=0;a0)return r(),F(l),c=new A["default"](L,"Segments update failed",null),void N.trigger(E["default"].DATA_UPDATE_COMPLETED,{sender:this,data:P,currentRepresentation:T,error:c});if(i){for(var o=0;o0&&a.Representation_asArray[0].hasOwnProperty("codecs")){var j=a.Representation_asArray[0].codecs;if("stpp"===j||"wvtt"===j)return"fragmentedText"===b}if(h){if(h.length>1)return"muxed"==b;h[0]&&h[0].contentType===b&&(f=!0,g=!0)}if(a.hasOwnProperty("mimeType")&&(f=i.test(a.mimeType),g=!0),!g)for(c=0,d=a.Representation_asArray.length;!g&&d>c;)e=a.Representation_asArray[c],e.hasOwnProperty("mimeType")&&(f=i.test(e.mimeType),g=!0),c++;return f}function b(b){return a(b,"audio")}function c(b){return a(b,"video")}function d(b){return a(b,"fragmentedText")}function e(b){return a(b,"text")}function f(b){return a(b,"muxed")}function h(a){return"text/vtt"===a||"application/ttml+xml"===a}function j(a){var b="";return a.hasOwnProperty("lang")&&(b=a.lang.replace(/[^A-Za-z0-9-]/g,"")),b}function l(a){return a.hasOwnProperty("Viewpoint")?a.Viewpoint:null}function n(a){return a.hasOwnProperty("Role_asArray")?a.Role_asArray:[]}function p(a){return a.hasOwnProperty("Accessibility_asArray")?a.Accessibility_asArray:[]}function r(a){return a.hasOwnProperty("AudioChannelConfiguration_asArray")?a.AudioChannelConfiguration_asArray:[]}function t(a){return n(a).filter(function(a){return"main"===a.value})[0]}function v(){return function(a,b){return a.bandwidth-b.bandwidth}}function x(a){return void 0!==a.Representation_asArray&&null!==a.Representation_asArray&&a.Representation_asArray.sort(v()),a}function z(a,b,c){var d,e,f=b.Period_asArray[c].AdaptationSet_asArray;for(d=0,e=f.length;e>d;d++)if(f[d].hasOwnProperty("id")&&f[d].id===a)return f[d];return null}function A(a,b,c){var d=b.Period_asArray[c].AdaptationSet_asArray;return d[a]}function B(a,b,c){var d,e,f=b.Period_asArray[c].AdaptationSet_asArray;for(d=0,e=f.length;e>d;d++)if(f[d]===a)return d;return-1}function C(b,c,d){var e,f,g=b.Period_asArray[c].AdaptationSet_asArray,h=[];for(e=0,f=g.length;f>e;e++)a(g[e],d)&&h.push(x(g[e]));return h}function D(a,b,c){var d,e,f;if(f=C(a,b,c),!f||0===f.length)return null;for(d=0,e=f.length;e>d;d++)if(t(f[d]))return f[d];return f[0]}function E(a){var b=a.Representation_asArray[0];return b.mimeType+';codecs="'+b.codecs+'"'}function F(a){return a.Representation_asArray[0].mimeType}function G(a){return a&&a.hasOwnProperty("cenc:default_KID")?a["cenc:default_KID"]:null}function H(a){return a&&a.hasOwnProperty("ContentProtection_asArray")&&0!==a.ContentProtection_asArray.length?a.ContentProtection_asArray:null}function I(a){var b=!1;return a.hasOwnProperty("type")&&(b="dynamic"===a.type),b}function J(a){var b,c,d=I(a);return b=!isNaN(a.timeShiftBufferDepth),c=d&&b}function K(a,b){var c=!1;return a.profiles&&a.profiles.length>0&&(c=-1!==a.profiles.indexOf(b)),c}function L(a){return K(a,"urn:mpeg:dash:profile:isoff-on-demand:2011")}function M(a){return K(a,"urn:dvb:dash:profile:dvb-dash:2014")}function N(a){var b;return b=a.hasOwnProperty("mediaPresentationDuration")?a.mediaPresentationDuration:Number.MAX_VALUE}function O(a){return a.bandwidth}function P(a){var b=NaN,c=2;return a.hasOwnProperty("minimumUpdatePeriod")&&(b=Math.max(parseFloat(a.minimumUpdatePeriod),c)),b}function Q(a){return a.Representation_asArray.length}function R(a){if(!a||!a.Representation_asArray||!a.Representation_asArray.length)return null;for(var b=x(a),c=b.Representation_asArray,d=c.length,e=[],f=0;d>f;f++)e.push({bandwidth:c[f].bandwidth,width:c[f].width||0,height:c[f].height||0});return e}function S(a,b){return b.Representation_asArray[a]}function T(a,b){for(var c,d,e,f,i,j=x(a.Period_asArray[b.period.index].AdaptationSet_asArray[b.index]),k=[],l=0;l=0)&&(c.useCalculatedLiveEdgeTime=!0)):c.segmentInfoType="SegmentTemplate",e.hasOwnProperty("initialization")&&(c.initialization=e.initialization.split("$Bandwidth$").join(f.bandwidth).split("$RepresentationID$").join(f.id))):(e=f.BaseURL,c.segmentInfoType="BaseURL"),e.hasOwnProperty("Initialization")?(d=e.Initialization,d.hasOwnProperty("sourceURL")?c.initialization=d.sourceURL:d.hasOwnProperty("range")&&(c.range=d.range)):f.hasOwnProperty("mimeType")&&h(f.mimeType)&&(c.range=0),e.hasOwnProperty("timescale")&&(c.timescale=e.timescale),e.hasOwnProperty("duration")&&(c.segmentDuration=e.duration/c.timescale),e.hasOwnProperty("startNumber")&&(c.startNumber=e.startNumber),e.hasOwnProperty("indexRange")&&(c.indexRange=e.indexRange),e.hasOwnProperty("presentationTimeOffset")&&(c.presentationTimeOffset=e.presentationTimeOffset/c.timescale),c.MSETimeOffset=ha.calcMSETimeOffset(c),c.path=[b.period.index,b.index,l],k.push(c);return k}function U(a,e){for(var g,h,j=a.Period_asArray[e.index],k=[],l=0;ld;d++)h=a.Period_asArray[d],h.hasOwnProperty("start")?(j=new k["default"],j.start=h.start):null!==g&&h.hasOwnProperty("duration")&&null!==i?(j=new k["default"],j.start=i.start+i.duration,j.duration=h.duration):0!==d||e||(j=new k["default"],j.start=0),null!==i&&isNaN(i.duration)&&(i.duration=j.start-i.start),null!==j&&(j.id=W(h)),null!==j&&h.hasOwnProperty("duration")&&(j.duration=h.duration),null!==j&&(j.index=d,j.mpd=b,f.push(j),g=h,i=j),h=null,j=null;return 0===f.length?f:(null!==i&&isNaN(i.duration)&&(i.duration=$(a,i)-i.start),f)}function W(a){if(!a)throw new Error("Period cannot be null or undefined");var b=k["default"].DEFAULT_ID;return a.hasOwnProperty("id")&&"__proto__"!==a.id&&(b=a.id),b}function X(a){var b=new m["default"];return b.manifest=a,a.hasOwnProperty("availabilityStartTime")?b.availabilityStartTime=new Date(a.availabilityStartTime.getTime()):b.availabilityStartTime=new Date(a.loadedTime.getTime()),a.hasOwnProperty("availabilityEndTime")&&(b.availabilityEndTime=new Date(a.availabilityEndTime.getTime())),a.hasOwnProperty("suggestedPresentationDelay")&&(b.suggestedPresentationDelay=a.suggestedPresentationDelay),a.hasOwnProperty("timeShiftBufferDepth")&&(b.timeShiftBufferDepth=a.timeShiftBufferDepth),a.hasOwnProperty("maxSegmentDuration")&&(b.maxSegmentDuration=a.maxSegmentDuration),b}function Y(a,b){return ha.calcPresentationTimeFromWallTime(a.loadedTime,b)}function Z(a,b){var c,d=NaN;return a.hasOwnProperty("minimumUpdatePeriod")&&(c=Y(a,b),d=c+a.minimumUpdatePeriod),d}function $(a,b){var c,d=Z(a,b);if(a.mediaPresentationDuration)c=a.mediaPresentationDuration;else{if(isNaN(d))throw new Error("Must have @mediaPresentationDuration or @minimumUpdatePeriod on MPD or an explicit @duration on the last period.");c=d}return c}function _(a,b){var c=a.Period_asArray,d=c[b.index].EventStream_asArray,e=[];if(d)for(var f=0;fj;j++)i=q.samples[j],b=void 0!==i.sample_duration?i.sample_duration:o.default_sample_duration,f=void 0!==i.sample_size?i.sample_size:o.default_sample_size,c=void 0!==i.sample_composition_time_offset?i.sample_composition_time_offset:0,h.push({dts:g,cts:g+c,duration:b,offset:r.offset+k,size:f}),k+=f,g+=b;return m=g-p.baseMediaDecodeTime,{sampleList:h,sequenceNumber:l,totalDuration:m}}function c(a){var b=e.parse(a),c=b.getBox("mdhd");return c?c.timescale:NaN}var d=void 0,e=void 0;return d={getSamplesInfo:b,getMediaTimescaleFromMoov:c,setConfig:a}}Object.defineProperty(c,"__esModule",{value:!0});var f=a("../../core/FactoryMaker.js"),g=d(f);e.__dashjs_factory_name="FragmentedTextBoxParser",c["default"]=g["default"].getSingletonFactory(e),b.exports=c["default"]},{"../../core/FactoryMaker.js":9}],21:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a,b){function c(a,c,e,f){var g,i,j,k,l,m,n,o=a.adaptation.period.mpd.manifest.Period_asArray[a.adaptation.period.index].AdaptationSet_asArray[a.adaptation.index].Representation_asArray[a.index].SegmentList,p=a.adaptation.period.mpd.manifest.Period_asArray[a.adaptation.period.index].AdaptationSet_asArray[a.adaptation.index].Representation_asArray[a.index].BaseURL,q=o.SegmentURL_asArray.length,r=[];for(n=a.startNumber,k=(0,h.decideSegmentListRangeForTemplate)(d,b,a,c,e,f),l=Math.max(k.start,0),m=Math.min(k.end,o.SegmentURL_asArray.length-1),g=l;m>=g;g++)j=o.SegmentURL_asArray[g],i=(0,h.getIndexBasedSegment)(d,b,a,g),i.replacementTime=(n+g-1)*a.segmentDuration,i.media=j.media?j.media:p,i.mediaRange=j.mediaRange,i.index=j.index,i.indexRange=j.indexRange,r.push(i),i=null;return a.availableSegmentsNumber=q,r}var d=a.timelineConverter,e=void 0;return e={getSegments:c}}Object.defineProperty(c,"__esModule",{value:!0});var f=a("../../core/FactoryMaker.js"),g=d(f),h=a("./SegmentsUtils.js");e.__dashjs_factory_name="ListSegmentsGetter";var i=g["default"].getClassFactory(e);c["default"]=i,b.exports=c["default"]},{"../../core/FactoryMaker.js":9,"./SegmentsUtils.js":23}],22:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a,b){function c(){h=(0,i["default"])(f).create(a,b),j=(0,k["default"])(f).create(a,b),l=(0,m["default"])(f).create(a,b)}function d(a,b,c,d,f){var g,i=a.segmentInfoType;return"SegmentBase"!==i&&"BaseURL"!==i&&e(a,c)?("SegmentTimeline"===i?g=h.getSegments(a,b,c,f):"SegmentTemplate"===i?g=j.getSegments(a,b,c,f):"SegmentList"===i&&(g=l.getSegments(a,b,c,f)),d&&d(a,g)):g=a.segments,g}function e(a,b){var c,d,e=a.segments,f=!1;return e&&0!==e.length?(d=e[0].availabilityIdx,c=e[e.length-1].availabilityIdx,f=d>b||b>c):f=!0,f}var f=this.context,g=void 0,h=void 0,j=void 0,l=void 0;return g={getSegments:d},c(),g}Object.defineProperty(c,"__esModule",{value:!0});var f=a("../../core/FactoryMaker.js"),g=d(f),h=a("./TimelineSegmentsGetter.js"),i=d(h),j=a("./TemplateSegmentsGetter.js"),k=d(j),l=a("./ListSegmentsGetter.js"),m=d(l);e.__dashjs_factory_name="SegmentsGetter";var n=g["default"].getClassFactory(e);c["default"]=n,b.exports=c["default"]},{"../../core/FactoryMaker.js":9,"./ListSegmentsGetter.js":21,"./TemplateSegmentsGetter.js":24,"./TimelineSegmentsGetter.js":26}],23:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a,b){for(;a.lengthd)return a;if(f=a.indexOf("$",d+l),0>f)return a;if(g=a.indexOf(k,d+l),g>d&&f>g)switch(h=a.charAt(f-1),i=parseInt(a.substring(g+m,f-1),10),h){case"d":case"i":case"u":j=e(c.toString(),i);break;case"x":j=e(c.toString(16),i);break;case"X":j=e(c.toString(16),i).toUpperCase();break;case"o":j=e(c.toString(8),i);break;default:return a}else j=c;a=a.substring(0,d)+j+a.substring(f+1)}}function h(a,b,c,d){var e,g,h,i;return g=c.segmentDuration,isNaN(g)&&(g=c.adaptation.period.duration),h=c.adaptation.period.start+d*g,i=h+g,e=new n["default"],e.representation=c,e.duration=g,e.presentationStartTime=h,e.mediaStartTime=a.calcMediaTimeFromPresentationTime(e.presentationStartTime,c),e.availabilityStartTime=a.calcAvailabilityStartTimeFromPresentationTime(e.presentationStartTime,c.adaptation.period.mpd,b),e.availabilityEndTime=a.calcAvailabilityEndTimeFromPresentationTime(i,c.adaptation.period.mpd,b),e.wallStartTime=a.calcWallTimeForSegment(e,b),e.replacementNumber=f(e,d),e.availabilityIdx=d,e}function i(a,b,c,d,e,h,i,j,k){var l,m,o,p=d/h,q=Math.min(e/h,c.adaptation.period.mpd.maxSegmentDuration);return l=a.calcPresentationTimeFromMediaTime(p,c),m=l+q,o=new n["default"],o.representation=c,o.duration=q,o.mediaStartTime=p,o.presentationStartTime=l,o.availabilityStartTime=c.adaptation.period.mpd.manifest.loadedTime,o.availabilityEndTime=a.calcAvailabilityEndTimeFromPresentationTime(m,c.adaptation.period.mpd,b),o.wallStartTime=a.calcWallTimeForSegment(o,b),o.replacementTime=d,o.replacementNumber=f(o,k),i=g(i,"Number",o.replacementNumber),i=g(i,"Time",o.replacementTime),o.media=i,o.mediaRange=j,o.availabilityIdx=k,o}function j(a,b){if(!b||!b.segments)return null;var c,d,e=b.segments.length;if(e>a&&(c=b.segments[a],c&&c.availabilityIdx===a))return c;for(d=0;e>d;d++)if(c=b.segments[d],c&&c.availabilityIdx===a)return c;return null}function k(a,b,c,d,e){var f,g,h,i=2,j=e||10,k=0,l=Number.POSITIVE_INFINITY;return b&&!a.isTimeSyncCompleted()?h={start:k,end:l}:!b&&c||0>d?null:(f=Math.max(d-i,k),g=Math.min(d+j,l),h={start:f,end:g})}function l(a,b,c,d,e,f){var g,h,i,k=c.segmentDuration,l=c.adaptation.period.mpd.manifest.minBufferTime,m=c.segmentAvailabilityRange,n={start:a.calcPeriodRelativeTimeFromMpdRelativeTime(c,m.start),end:a.calcPeriodRelativeTimeFromMpdRelativeTime(c,m.end)},o=c.segments,p=2*k,q=f||Math.max(2*l,10*k),r=NaN,s=null;return n.start=Math.max(n.start,0),b&&!a.isTimeSyncCompleted()?(g=Math.floor(n.start/k),h=Math.floor(n.end/k),i={start:g,end:h}):(o&&o.length>0?(s=j(e,c),r=s?a.calcPeriodRelativeTimeFromMpdRelativeTime(c,s.presentationStartTime):e>0?e*k:a.calcPeriodRelativeTimeFromMpdRelativeTime(c,d)):r=e>0?e*k:b?n.end:n.start,g=Math.floor(Math.max(r-p,n.start)/k),h=Math.floor(Math.min(g+q/k,n.end/k)),i={start:g,end:h})}Object.defineProperty(c,"__esModule",{value:!0}),c.replaceTokenForTemplate=g,c.getIndexBasedSegment=h,c.getTimeBasedSegment=i,c.getSegmentByIndex=j,c.decideSegmentListRangeForTimeline=k,c.decideSegmentListRangeForTemplate=l;var m=a("./../vo/Segment.js"),n=d(m)},{"./../vo/Segment.js":34}],24:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a,b){function c(a,c,e,f){var g,i,j,k,l,m=a.adaptation.period.mpd.manifest.Period_asArray[a.adaptation.period.index].AdaptationSet_asArray[a.adaptation.index].Representation_asArray[a.index].SegmentTemplate,n=a.segmentDuration,o=a.segmentAvailabilityRange,p=[],q=null,r=null;for(l=a.startNumber,g=isNaN(n)&&!b?{start:l,end:l}:(0,h.decideSegmentListRangeForTemplate)(d,b,a,c,e,f),j=g.start,k=g.end,i=j;k>=i;i++)r=(0,h.getIndexBasedSegment)(d,b,a,i),r.replacementTime=(l+i-1)*a.segmentDuration,q=m.media,q=(0,h.replaceTokenForTemplate)(q,"Number",r.replacementNumber),q=(0,h.replaceTokenForTemplate)(q,"Time",r.replacementTime),r.media=q,p.push(r),r=null;return isNaN(n)?a.availableSegmentsNumber=1:a.availableSegmentsNumber=Math.ceil((o.end-o.start)/n),p}var d=a.timelineConverter,e=void 0;return e={getSegments:c}}Object.defineProperty(c,"__esModule",{value:!0});var f=a("../../core/FactoryMaker.js"),g=d(f),h=a("./SegmentsUtils.js");e.__dashjs_factory_name="TemplateSegmentsGetter";var i=g["default"].getClassFactory(e);c["default"]=i,b.exports=c["default"]},{"../../core/FactoryMaker.js":9,"./SegmentsUtils.js":23}],25:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(){function a(){z=0,A=!1,B=NaN,x.on(i["default"].LIVE_EDGE_SEARCH_COMPLETED,s,this),x.on(i["default"].TIME_SYNCHRONIZATION_COMPLETED,t,this)}function b(){return A}function c(a){A=a}function d(){return z}function e(){return B}function f(a){B=a}function h(a,b,c,d){var e=NaN;return e=d?c&&b.timeShiftBufferDepth!=Number.POSITIVE_INFINITY?new Date(b.availabilityStartTime.getTime()+1e3*(a+b.timeShiftBufferDepth)):b.availabilityEndTime:c?new Date(b.availabilityStartTime.getTime()+1e3*(a-z)):b.availabilityStartTime}function j(a,b,c){return h.call(this,a,b,c)}function k(a,b,c){return h.call(this,a,b,c,!0)}function l(a,b){return(a.getTime()-b.mpd.availabilityStartTime.getTime()+1e3*z)/1e3}function m(a,b){var c=b.adaptation.period.start,d=b.presentationTimeOffset;return a+(c-d)}function n(a,b){var c=b.adaptation.period.start,d=b.presentationTimeOffset;return a-c+d}function o(a,b){var c,d,e;return b&&(c=a.representation.adaptation.period.mpd.suggestedPresentationDelay,d=a.presentationStartTime+c,e=new Date(a.availabilityStartTime.getTime()+1e3*d)),e}function p(a,b){var c,d,e=a.adaptation.period.start,f=e+a.adaptation.period.duration,g={start:e,end:f},h=a.segmentDuration||(a.segments&&a.segments.length?a.segments[a.segments.length-1].duration:0);if(!b)return g;if(!A&&a.segmentAvailabilityRange)return a.segmentAvailabilityRange;c=a.adaptation.period.mpd.checkTime,d=l(new Date,a.adaptation.period),e=Math.max(d-a.adaptation.period.mpd.timeShiftBufferDepth,a.adaptation.period.start);var i=isNaN(c)?d:Math.min(c,d),j=a.adaptation.period.start+a.adaptation.period.duration;return f=(i>=j&&j>i-h?j:i)-h,g={start:e,end:f}}function q(a,b){var c=a.adaptation.period.start;return b-c}function r(a,b){var c=a.adaptation.period.start;return b+c}function s(a){A||a.error||(z+=a.liveEdge-(B+a.searchTime),A=!0)}function t(a){A||a.error||(z=a.offset/1e3,A=!0)}function u(a){var b=a.presentationTimeOffset,c=a.adaptation.period.start;return c-b}function v(){x.off(i["default"].LIVE_EDGE_SEARCH_COMPLETED,s,this),x.off(i["default"].TIME_SYNCHRONIZATION_COMPLETED,t,this),z=0,A=!1,B=NaN}var w=this.context,x=(0,g["default"])(w).getInstance(),y=void 0,z=void 0,A=void 0,B=void 0;return y={initialize:a,isTimeSyncCompleted:b,setTimeSyncCompleted:c,getClientTimeOffset:d,getExpectedLiveEdge:e,setExpectedLiveEdge:f,calcAvailabilityStartTimeFromPresentationTime:j,calcAvailabilityEndTimeFromPresentationTime:k,calcPresentationTimeFromWallTime:l,calcPresentationTimeFromMediaTime:m,calcPeriodRelativeTimeFromMpdRelativeTime:q,calcMpdRelativeTimeFromPeriodRelativeTime:r,calcMediaTimeFromPresentationTime:n,calcSegmentAvailabilityRange:p,calcWallTimeForSegment:o,calcMSETimeOffset:u,reset:v}}Object.defineProperty(c,"__esModule",{value:!0});var f=a("../../core/EventBus.js"),g=d(f),h=a("../../core/events/Events.js"),i=d(h),j=a("../../core/FactoryMaker.js"),k=d(j);e.__dashjs_factory_name="TimelineConverter",c["default"]=k["default"].getSingletonFactory(e),b.exports=c["default"]},{"../../core/EventBus.js":8,"../../core/FactoryMaker.js":9,"../../core/events/Events.js":11}],26:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a,b){function c(a,c,e,f){var g,i,j,k,l,m,n,o,p,q,r,s,t,u,v=a.adaptation.period.mpd.manifest.Period_asArray[a.adaptation.period.index].AdaptationSet_asArray[a.adaptation.index].Representation_asArray[a.index].SegmentTemplate,w=v.SegmentTimeline,x=a.availableSegmentsNumber>0,y=10,z=0,A=0,B=-1,C=[],D=!1,E=function(c){return(0,h.getTimeBasedSegment)(d,b,a,z,c.d,u,v.media,c.mediaRange,B)};for(u=a.timescale,g=w.S_asArray,p=(0,h.decideSegmentListRangeForTimeline)(d,b,c,e,f),p?(s=p.start,t=p.end):r=d.calcMediaTimeFromPresentationTime(c||0,a),j=0,k=g.length;k>j;j++){if(i=g[j],m=0,i.hasOwnProperty("r")&&(m=i.r),i.hasOwnProperty("t")&&(z=i.t,A=z/u),0>m){if(o=g[j+1],o&&o.hasOwnProperty("t"))n=o.t/u;else{var F=a.segmentAvailabilityRange?a.segmentAvailabilityRange.end:d.calcSegmentAvailabilityRange(a,b).end;n=d.calcMediaTimeFromPresentationTime(F,a),a.segmentDuration=i.d/u}m=Math.ceil((n-A)/(i.d/u))-1}if(q){if(x)break;B+=m+1}else for(l=0;m>=l;l++){if(B++,p){if(B>t){if(q=!0,x)break;continue}B>=s&&C.push(E(i))}else{if(C.length>y){if(q=!0,x)break;continue}D?C.push(E(i)):A>=r-i.d/u*1.5&&(D=!0,C.push(E(i)))}z+=i.d,A=z/u}}return x||(a.availableSegmentsNumber=B+1),C}var d=a.timelineConverter,e=void 0;return e={getSegments:c}}Object.defineProperty(c,"__esModule",{value:!0});var f=a("../../core/FactoryMaker.js"),g=d(f),h=a("./SegmentsUtils.js");e.__dashjs_factory_name="TimelineSegmentsGetter";var i=g["default"].getClassFactory(e);c["default"]=i,b.exports=c["default"]},{"../../core/FactoryMaker.js":9,"./SegmentsUtils.js":23}],27:[function(a,b,c){"use strict";function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(c,"__esModule",{value:!0});var e=function f(){d(this,f),this.period=null,this.index=-1,this.type=null};c["default"]=e,b.exports=c["default"]},{}],28:[function(a,b,c){"use strict";function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(c,"__esModule",{value:!0});var e=1,f=1,g=function h(a,b,c,g){d(this,h),this.url=a||"",this.serviceLocation=b||a||"",this.dvb_priority=c||e,this.dvb_weight=g||f};g.DEFAULT_DVB_PRIORITY=e,g.DEFAULT_DVB_WEIGHT=f,c["default"]=g,b.exports=c["default"]},{}],29:[function(a,b,c){"use strict";function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(c,"__esModule",{value:!0});var e=function f(){d(this,f),this.duration=NaN,this.presentationTime=NaN,this.id=NaN,this.messageData="",this.eventStream=null,this.presentationTimeDelta=NaN};c["default"]=e,b.exports=c["default"]},{}],30:[function(a,b,c){"use strict";function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(c,"__esModule",{value:!0});var e=function f(){d(this,f),this.adaptionSet=null,this.representation=null,this.period=null,this.timescale=1,this.value="",this.schemeIdUri=""};c["default"]=e,b.exports=c["default"]},{}],31:[function(a,b,c){"use strict";function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(c,"__esModule",{value:!0});var e=function f(){d(this,f),this.manifest=null,this.suggestedPresentationDelay=0,this.availabilityStartTime=null,this.availabilityEndTime=Number.POSITIVE_INFINITY,this.timeShiftBufferDepth=Number.POSITIVE_INFINITY,this.maxSegmentDuration=Number.POSITIVE_INFINITY,this.checkTime=NaN,this.clientServerTimeShift=0,this.isClientServerTimeSyncCompleted=!1};c["default"]=e,b.exports=c["default"]},{}],32:[function(a,b,c){"use strict";function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(c,"__esModule",{value:!0});var e=function f(){d(this,f),this.id=null,this.index=-1,this.duration=NaN,this.start=NaN,this.mpd=null};e.DEFAULT_ID="defaultId",c["default"]=e,b.exports=c["default"]},{}],33:[function(a,b,c){"use strict";function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(c,"__esModule",{value:!0});var e=function f(){d(this,f),this.id=null,this.index=-1,this.adaptation=null,this.segmentInfoType=null,this.initialization=null,this.segmentDuration=NaN,this.timescale=1,this.startNumber=1,this.indexRange=null,this.range=null,this.presentationTimeOffset=0,this.MSETimeOffset=NaN,this.segmentAvailabilityRange=null,this.availableSegmentsNumber=0,this.bandwidth=NaN,this.maxPlayoutRate=NaN};c["default"]=e,b.exports=c["default"]},{}],34:[function(a,b,c){"use strict";function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(c,"__esModule",{value:!0});var e=function f(){d(this,f),this.indexRange=null,this.index=null,this.mediaRange=null,this.media=null,this.duration=NaN,this.replacementTime=null,this.replacementNumber=NaN,this.mediaStartTime=NaN,this.presentationStartTime=NaN,this.availabilityStartTime=NaN,this.availabilityEndTime=NaN,this.availabilityIdx=NaN,this.wallStartTime=NaN,this.representation=null};c["default"]=e,b.exports=c["default"]},{}],35:[function(a,b,c){"use strict";function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(c,"__esModule",{value:!0});var e=function f(){d(this,f),this.schemeIdUri="",this.value=""};c["default"]=e,b.exports=c["default"]},{}],36:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a){function b(){n=(0,g["default"])(h).create({errHandler:a.errHandler,metricsModel:a.metricsModel,requestModifier:a.requestModifier})}function c(a){var b=function(b){j.trigger(o["default"].CHECK_FOR_EXISTENCE_COMPLETED,{request:a,exists:b})};if(a){var c=new i["default"](a.url);n.load({request:c,success:function(){b(!0)},error:function(){b(!1)}})}else b(!1)}function d(a){var b=function(b,c){j.trigger(o["default"].LOADING_COMPLETED,{request:a,response:b||null,error:c||null,sender:l})};a?n.load({request:a,progress:function(){j.trigger(o["default"].LOADING_PROGRESS,{request:a})},success:function(a){b(a)},error:function(a,c,d){b(void 0,new k["default"](r,d,c))}}):b(void 0,new k["default"](s,t))}function e(){n&&n.abort()}function f(){n&&(n.abort(),n=null)}var h=this.context,j=(0,m["default"])(h).getInstance(),l=void 0,n=void 0;return l={checkForExistence:c,load:d,abort:e,reset:f},b(),l}Object.defineProperty(c,"__esModule",{value:!0});var f=a("./XHRLoader.js"),g=d(f),h=a("./vo/HeadRequest.js"),i=d(h),j=a("./vo/Error.js"),k=d(j),l=a("./../core/EventBus.js"),m=d(l),n=a("./../core/events/Events.js"),o=d(n),p=a("../core/FactoryMaker.js"),q=d(p),r=1,s=2,t="request is null";e.__dashjs_factory_name="FragmentLoader";var u=q["default"].getClassFactory(e);u.FRAGMENT_LOADER_ERROR_LOADING_FAILURE=r,u.FRAGMENT_LOADER_ERROR_NULL_REQUEST=s,c["default"]=u,b.exports=c["default"]},{"../core/FactoryMaker.js":9,"./../core/EventBus.js":8,"./../core/events/Events.js":11,"./XHRLoader.js":47,"./vo/Error.js":149,"./vo/HeadRequest.js":151}],37:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a){function b(){h.on(u["default"].XLINK_READY,c,n),p=(0,i["default"])(f).create({errHandler:a.errHandler,metricsModel:a.metricsModel,requestModifier:a.requestModifier}),r=(0,g["default"])(f).create({errHandler:a.errHandler,metricsModel:a.metricsModel,requestModifier:a.requestModifier})}function c(a){h.trigger(u["default"].INTERNAL_MANIFEST_LOADED,{manifest:a.manifest})}function d(a){var b=new m["default"](a,q["default"].MPD_TYPE);p.load({request:b,success:function(b,c,d){var e,f;d.responseURL&&d.responseURL!==a?(f=j.parseBaseUrl(d.responseURL),e=d.responseURL):(j.isRelative(a)&&(a=j.parseBaseUrl(window.location.href)+a),f=j.parseBaseUrl(a));var g=l.parse(b,r);g?(g.url=e||a,g.originalUrl||(g.originalUrl=g.url),g.baseUri=f,g.loadedTime=new Date,r.resolveManifestOnLoad(g)):h.trigger(u["default"].INTERNAL_MANIFEST_LOADED,{manifest:null,error:new o["default"](x,z)})},error:function(b,c,d){h.trigger(u["default"].INTERNAL_MANIFEST_LOADED,{manifest:null,error:new o["default"](y,"Failed loading manifest: "+a+", "+d)})}})}function e(){h.off(u["default"].XLINK_READY,c,n),r&&(r.reset(),r=null),p&&(p.abort(),p=null)}var f=this.context,h=(0,s["default"])(f).getInstance(),j=(0,k["default"])(f).getInstance(),l=a.parser,n=void 0,p=void 0,r=void 0;return n={load:d,reset:e},b(),n}Object.defineProperty(c,"__esModule",{value:!0});var f=a("./controllers/XlinkController.js"),g=d(f),h=a("./XHRLoader.js"),i=d(h),j=a("./utils/URLUtils.js"),k=d(j),l=a("./vo/TextRequest.js"),m=d(l),n=a("./vo/Error.js"),o=d(n),p=a("./vo/metrics/HTTPRequest.js"),q=d(p),r=a("../core/EventBus.js"),s=d(r),t=a("../core/events/Events.js"),u=d(t),v=a("../core/FactoryMaker.js"),w=d(v),x=1,y=2,z="parsing failed";e.__dashjs_factory_name="ManifestLoader";var A=w["default"].getClassFactory(e);A.MANIFEST_LOADER_ERROR_PARSING_FAILURE=x,A.MANIFEST_LOADER_ERROR_LOADING_FAILURE=y,c["default"]=A,b.exports=c["default"]},{"../core/EventBus.js":8,"../core/FactoryMaker.js":9,"../core/events/Events.js":11,"./XHRLoader.js":47,"./controllers/XlinkController.js":63,"./utils/URLUtils.js":145,"./vo/Error.js":149,"./vo/TextRequest.js":157,"./vo/metrics/HTTPRequest.js":166}],38:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(){function a(a){a&&(a.manifestModel&&(z=a.manifestModel),a.dashManifestModel&&(A=a.dashManifestModel))}function b(a){y=a,u=NaN,v=null,x=!1,w=!0,s.on(i["default"].STREAMS_COMPOSED,p,this),s.on(i["default"].PLAYBACK_STARTED,n,this),s.on(i["default"].PLAYBACK_PAUSED,o,this),s.on(i["default"].INTERNAL_MANIFEST_LOADED,l,this)}function c(a){j(a)}function d(){return y}function e(){s.off(i["default"].PLAYBACK_STARTED,n,this),s.off(i["default"].PLAYBACK_PAUSED,o,this),s.off(i["default"].STREAMS_COMPOSED,p,this),s.off(i["default"].INTERNAL_MANIFEST_LOADED,l,this),w=!0,x=!1,f(),u=NaN}function f(){null!==v&&(clearInterval(v),v=null)}function h(){f(),isNaN(u)||(r("Refresh manifest in "+u+" seconds."),v=setTimeout(k,Math.min(1e3*u,Math.pow(2,31)-1),this))}function j(a){var b,c,d=new Date;z.setValue(a),r("Manifest has been refreshed at "+d+"["+d.getTime()/1e3+"] "),b=A.getRefreshDelay(a),c=((new Date).getTime()-a.loadedTime.getTime())/1e3,u=Math.max(b-c,0),s.trigger(i["default"].MANIFEST_UPDATED,{manifest:a}),w||h()}function k(){var a,b;w||x||(x=!0,a=z.getValue(),b=a.url,a.hasOwnProperty("Location")&&(b=a.Location),y.load(b))}function l(a){a.error||j(a.manifest)}function n(){w=!1,h()}function o(){w=!0,f()}function p(){x=!1}var q=this.context,r=(0,m["default"])(q).getInstance().log,s=(0,g["default"])(q).getInstance(),t=void 0,u=void 0,v=void 0,w=void 0,x=void 0,y=void 0,z=void 0,A=void 0;return t={initialize:b,setManifest:c,getManifestLoader:d,setConfig:a,reset:e}}Object.defineProperty(c,"__esModule",{value:!0});var f=a("../core/EventBus.js"),g=d(f),h=a("../core/events/Events.js"),i=d(h),j=a("../core/FactoryMaker.js"),k=d(j),l=a("../core/Debug.js"),m=d(l);e.__dashjs_factory_name="ManifestUpdater",c["default"]=k["default"].getSingletonFactory(e),b.exports=c["default"]},{"../core/Debug.js":7,"../core/EventBus.js":8,"../core/FactoryMaker.js":9,"../core/events/Events.js":11}],39:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(){function a(){Xb=!1,Yb=!1,Zb=!0,ac=null,Wb=null,cc=null,ga["default"].extend(ia["default"]),ec=(0,K["default"])(Qb).getInstance()}function b(a,b,c){return gc=(0,u["default"])(Qb).getInstance(),fc=(0,s["default"])(Qb).getInstance(),gc.supportsMediaSource()?void(Xb||(Xb=!0,$b=(0,O["default"])(Qb).getInstance(),jc=(0,i["default"])(Qb).getInstance(),_b=(0,m["default"])(Qb).getInstance(),_b.initialize(),lc=(0,qa["default"])(Qb).getInstance(),kc=(0,sa["default"])(Qb).getInstance(),dc=(0,M["default"])(Qb).getInstance(),dc.setConfig({adapter:Eb()}),_a(),na(void 0!==c?c:!0),a&&ub(a),b&&yb(b),Tb("[dash.js "+Lb+"] MediaPlayer has been initialized"))):void fc.capabilityError("mediasource")}function c(){return!!mc&&!!Vb}function d(){if(!Yb)throw Mb;(!Zb||f()&&Yb)&&jc.play()}function e(){if(!Yb)throw Mb;jc.pause()}function f(){if(!Yb)throw Mb;return jc.isPaused()}function h(){if(!Yb)throw Mb;return jc.isSeeking()}function j(a){if(!mc)throw Nb;tb().muted=a}function l(){if(!mc)throw Nb;return tb().muted}function n(a){if(!mc)throw Nb;tb().volume=a}function p(){if(!mc)throw Nb;return tb().volume}function r(a){if(a){if("video"===a||"audio"===a||"fragmentedText"===a){var b=va().getCurrentBufferLevel(wa(a));return b?b.toPrecision(3):NaN}return Tb("Warning - getBufferLength requested for invalid type"),NaN}var c=Ia("video").length>0?va().getCurrentBufferLevel(wa("video")):Number.MAX_SAFE_INTEGER,d=Ia("audio").length>0?va().getCurrentBufferLevel(wa("audio")):Number.MAX_SAFE_INTEGER,e=Ia("fragmentedText").length>0?va().getCurrentBufferLevel(wa("fragmentedText")):Number.MAX_SAFE_INTEGER;return Math.min(c,d,e).toPrecision(3)}function t(){var a=Hb();return a?a.manifestInfo.DVRWindowSize:0}function v(a){var b=Hb();if(!b)return 0;var c=b.range.start+a;return c>b.range.end&&(c=b.range.end),c}function x(a){if(!Yb)throw Mb;var b=jc.getIsDynamic()?v(a):a;jc.seek(b)}function z(a){if(!Yb)throw Mb;var b=tb().currentTime;if(void 0!==a&&(b=hc.getTimeRelativeToStreamId(b,a)),jc.getIsDynamic()){var c=Hb();b=null===c?0:B()-(c.range.end-c.time)}return b}function B(){if(!Yb)throw Mb;var a=tb().duration;if(jc.getIsDynamic()){var b,c=Hb();if(!c)return 0;b=c.range.end-c.range.start,a=bb?"0"+b.toString()+":":b.toString()+":")+(10>c?"0"+c.toString():c.toString())+":"+(10>d?"0"+d.toString():d.toString())}function L(a,b,c){ka["default"].extend(a,b,c,Qb)}function N(a,b,c){Rb.on(a,b,c)}function P(a,b,c){Rb.off(a,b,c)}function R(){return Lb}function T(){return Sb}function V(){if(!mc)throw Nb;return mc}function X(a){ec.setLiveDelayFragmentCount(a)}function Z(a){ec.setLiveDelay(a)}function _(a){ec.setUseSuggestedPresentationDelay(a)}function ba(a,b){ec.setLastBitrateCachingInfo(a,b)}function da(a,b){ec.setLastMediaSettingsCachingInfo(a,b)}function fa(a,b){$b.setMaxAllowedBitrateFor(a,b)}function ha(a){return $b.getMaxAllowedBitrateFor(a)}function ja(a,b){$b.setMaxAllowedRepresentationRatioFor(a,b)}function la(a){return $b.getMaxAllowedRepresentationRatioFor(a)}function na(a){Zb=a}function pa(){return Zb}function ra(a){ec.setScheduleWhilePaused(a)}function ta(){return ec.getScheduleWhilePaused()}function va(){return kc}function wa(a){return dc.getReadOnlyMetricsFor(a)}function xa(a){if(!Yb)throw Mb;return $b.getQualityFor(a,hc.getActiveStreamInfo())}function ya(a,b){if(!Yb)throw Mb;$b.setPlaybackQuality(a,hc.getActiveStreamInfo(),b)}function za(){return $b.getLimitBitrateByPortal()}function Aa(a){$b.setLimitBitrateByPortal(a)}function Ba(a){if(!Yb)throw Mb;void 0===nc&&(nc=(0,E["default"])(Qb).getInstance());for(var b=tb().textTracks,c=b.length,d=0;c>d;d++){var e=b[d],f=a===d?"showing":"hidden";e.mode!==f&&(e.mode=f)}nc.setTextTrack()}function Ca(a){if(!Yb)throw Mb;var b=Jb();return b?b.getBitrateListFor(a):[]}function Da(a,b){$b.setInitialBitrateFor(a,b)}function Ea(a){if(!Yb)throw Mb;return $b.getInitialBitrateFor(a)}function Fa(a,b){$b.setInitialRepresentationRatioFor(a,b)}function Ga(a){return $b.getInitialRepresentationRatioFor(a)}function Ha(a){if(!Yb)throw Mb;return cc.getStreamsInfo(a)}function Ia(a){if(!Yb)throw Mb;var b=hc.getActiveStreamInfo();return b?_b.getTracksFor(a,b):[]}function Ja(a,b,c){if(!Yb)throw Mb;return c=c||cc.getStreamsInfo(b)[0],c?cc.getAllMediaInfoForType(b,c,a):[]}function Ka(a){if(!Yb)throw Mb;var b=hc.getActiveStreamInfo();return b?_b.getCurrentTrackFor(a,b):null}function La(a,b){_b.setInitialSettings(a,b)}function Ma(a){return _b.getInitialSettings(a)}function Na(a){if(!Yb)throw Mb;_b.setTrack(a)}function Oa(a){return _b.getSwitchMode(a)}function Pa(a,b){_b.setSwitchMode(a,b)}function Qa(a){_b.setSelectionModeForInitialTrack(a)}function Ra(){return _b.getSelectionModeForInitialTrack()}function Sa(){return $b.getAutoSwitchBitrateFor("video")||$b.getAutoSwitchBitrateFor("audio")}function Ta(a){$b.setAutoSwitchBitrateFor("video",a),$b.setAutoSwitchBitrateFor("audio",a)}function Ua(a){return $b.getAutoSwitchBitrateFor(a)}function Va(a,b){$b.setAutoSwitchBitrateFor(a,b)}function Wa(a){ec.setBufferOccupancyABREnabled(a)}function Xa(a,b){var c=Cb(),d=this,e=function g(a){a.error?b(null,a.error):b(a.manifest),Rb.off(ga["default"].INTERNAL_MANIFEST_LOADED,g,d),c.reset()};Rb.on(ga["default"].INTERNAL_MANIFEST_LOADED,e,d);var f=(0,G["default"])(Qb).getInstance();f.initialize(),c.load(f.parseURI(a))}function Ya(a,b){Za(a,b);var c=new g["default"];c.schemeIdUri=a,c.value=b,ec.getUTCTimingSources().push(c)}function Za(a,b){var c=ec.getUTCTimingSources();c.forEach(function(d,e){d.schemeIdUri===a&&d.value===b&&c.splice(e,1)})}function $a(){ec.setUTCTimingSources([])}function _a(){Ya(K["default"].DEFAULT_UTC_TIMING_SOURCE.scheme,K["default"].DEFAULT_UTC_TIMING_SOURCE.value)}function ab(a){ec.setUseManifestDateHeaderTimeSource(a)}function bb(a){ec.setBufferToKeep(a)}function cb(a){ec.setBufferPruningInterval(a)}function db(a){ec.setStableBufferTime(a)}function eb(a){ec.setBufferTimeAtTopQuality(a)}function fb(a){ec.setBufferTimeAtTopQualityLongForm(a)}function gb(a){ec.setLongFormContentDurationThreshold(a)}function hb(a){ec.setRichBufferThreshold(a)}function ib(a){ec.setBandwidthSafetyFactor(a)}function jb(){return ec.getBandwidthSafetyFactor()}function kb(a){ec.setAbandonLoadTimeout(a)}function lb(a){ec.setFragmentRetryAttempts(a)}function mb(a){ec.setFragmentRetryInterval(a)}function nb(){return Fb()}function ob(a){ac=a}function pb(a){Wb=a}function qb(a){var b=(0,w["default"])(Qb).getInstance();b.setConfig({videoModel:mc}),b.initialize(),b.displayCConTop(a)}function rb(){return mc?mc.getVideoContainer():null}function sb(a){if(!mc)throw Nb;mc.setVideoContainer(a)}function tb(){if(!mc)throw Nb;return mc.getElement()}function ub(a){if(!Xb)throw Pb;mc=null,a&&(mc=(0,U["default"])(Qb).getInstance(),mc.initialize(),mc.setElement(a),Fb(),Gb()),Ab()}function vb(){return mc?mc.getTTMLRenderingDiv():null}function wb(a){if(!mc)throw Nb;mc.setTTMLRenderingDiv(a)}function xb(){if(!Vb)throw Ob;return Vb}function yb(a){if(!Xb)throw Pb;if("string"==typeof a){var b=(0,G["default"])(Qb).getInstance();b.initialize(),Vb=b.parseURI(a)}else Vb=a;Ab()}function zb(){yb(null),ub(null),Wb=null,ac=null}function Ab(){Yb?(Yb=!1,cc.reset(),hc.reset(),jc.reset(),$b.reset(),ic.reset(),_b.reset(),hc=null,bc=null,c()&&Kb()):c()&&Kb()}function Bb(){var a=(0,Y["default"])(Qb).getInstance();a.initialize();var b=(0,S["default"])(Qb).getInstance();b.initialize();var c=(0,y["default"])(Qb).getInstance();c.setConfig({dashManifestModel:lc});var d=(0,A["default"])(Qb).getInstance();d.setConfig({sourceBufferController:c}),_b.initialize(),_b.setConfig({errHandler:fc}),ic=(0,W["default"])(Qb).getInstance(),ic.initialize(),ic.setConfig({abrRulesCollection:b,synchronizationRulesCollection:a}),hc=(0,k["default"])(Qb).getInstance(),hc.setConfig({capabilities:gc,manifestLoader:Cb(),manifestModel:(0,I["default"])(Qb).getInstance(),dashManifestModel:lc,protectionController:ac,adapter:cc,metricsModel:dc,dashMetrics:kc,liveEdgeFinder:(0,q["default"])(Qb).getInstance(),mediaSourceController:(0,$["default"])(Qb).getInstance(),timeSyncController:(0,Q["default"])(Qb).getInstance(),baseURLController:(0,aa["default"])(Qb).getInstance(),virtualBuffer:d,errHandler:fc,timelineConverter:(0,ua["default"])(Qb).getInstance()}),hc.initialize(Zb,Wb),$b.setConfig({abrRulesCollection:b,rulesController:ic,streamController:hc})}function Cb(){return(0,o["default"])(Qb).create({errHandler:fc,parser:Db(),metricsModel:dc,requestModifier:(0,C["default"])(Qb).getInstance()})}function Db(){return(0,oa["default"])(Qb).create()}function Eb(){return cc=(0,ma["default"])(Qb).getInstance(),cc.initialize(),cc.setConfig({dashManifestModel:lc}),cc}function Fb(){if(ac)return ac;var a=dashjs.Protection;if("function"==typeof a){var b=a(Qb).create();return ga["default"].extend(a.events),ia["default"].extend(a.events,{publicOnly:!0}),ac=b.createProtectionSystem({ +log:Tb,videoModel:mc,capabilities:gc,eventBus:Rb,adapter:cc})}return null}function Gb(){if(bc)return bc;var a=dashjs.MetricsReporting;if("function"==typeof a){var b=a(Qb).create();return bc=b.createMetricsReporting({log:Tb,eventBus:Rb,mediaElement:tb(),dashManifestModel:lc,metricsModel:dc})}return null}function Hb(){var a=dc.getReadOnlyMetricsFor("video")||dc.getReadOnlyMetricsFor("audio");return kc.getCurrentDVRInfo(a)}function Ib(a){var b,c,d=Hb();return d?(b=d.manifestInfo.availableFrom.getTime()/1e3,c=a+(b+d.range.start)):0}function Jb(){if(!Yb)throw Mb;var a=hc.getActiveStreamInfo();return a?hc.getStreamById(a.id):null}function Kb(){Yb||(Yb=!0,Tb("Playback Initialized"),Bb(),"string"==typeof Vb?hc.load(Vb):hc.loadWithManifest(Vb))}var Lb="2.1.1",Mb="You must first call play() to init playback before calling this method",Nb="You must first call attachView() to set the video element before calling this method",Ob="You must first call attachSource() with a valid source before calling this method",Pb="MediaPlayer not initialized!",Qb=this.context,Rb=(0,ea["default"])(Qb).getInstance(),Sb=(0,ca["default"])(Qb).getInstance(),Tb=Sb.log,Ub=void 0,Vb=void 0,Wb=void 0,Xb=void 0,Yb=void 0,Zb=void 0,$b=void 0,_b=void 0,ac=void 0,bc=void 0,cc=void 0,dc=void 0,ec=void 0,fc=void 0,gc=void 0,hc=void 0,ic=void 0,jc=void 0,kc=void 0,lc=void 0,mc=void 0,nc=void 0;return Ub={initialize:b,on:N,off:P,extend:L,attachView:ub,attachSource:yb,isReady:c,play:d,isPaused:f,pause:e,isSeeking:h,seek:x,setMute:j,isMuted:l,setVolume:n,getVolume:p,time:z,duration:B,timeAsUTC:D,durationAsUTC:F,getActiveStream:Jb,getDVRWindowSize:t,getDVRSeekOffset:v,convertToTimeCode:J,formatUTC:H,getVersion:R,getDebug:T,getBufferLength:r,getVideoModel:V,getVideoContainer:rb,getTTMLRenderingDiv:vb,getVideoElement:tb,getSource:xb,setLiveDelayFragmentCount:X,setLiveDelay:Z,useSuggestedPresentationDelay:_,enableLastBitrateCaching:ba,enableLastMediaSettingsCaching:da,setMaxAllowedBitrateFor:fa,getMaxAllowedBitrateFor:ha,setMaxAllowedRepresentationRatioFor:ja,getMaxAllowedRepresentationRatioFor:la,setAutoPlay:na,getAutoPlay:pa,setScheduleWhilePaused:ra,getScheduleWhilePaused:ta,getDashMetrics:va,getMetricsFor:wa,getQualityFor:xa,setQualityFor:ya,getLimitBitrateByPortal:za,setLimitBitrateByPortal:Aa,setTextTrack:Ba,getBitrateInfoListFor:Ca,setInitialBitrateFor:Da,getInitialBitrateFor:Ea,setInitialRepresentationRatioFor:Fa,getInitialRepresentationRatioFor:Ga,getStreamsFromManifest:Ha,getTracksFor:Ia,getTracksForTypeFromManifest:Ja,getCurrentTrackFor:Ka,setInitialMediaSettingsFor:La,getInitialMediaSettingsFor:Ma,setCurrentTrack:Na,getTrackSwitchModeFor:Oa,setTrackSwitchModeFor:Pa,setSelectionModeForInitialTrack:Qa,getSelectionModeForInitialTrack:Ra,getAutoSwitchQuality:Sa,setAutoSwitchQuality:Ta,getAutoSwitchQualityFor:Ua,setAutoSwitchQualityFor:Va,enableBufferOccupancyABR:Wa,setBandwidthSafetyFactor:ib,getBandwidthSafetyFactor:jb,setAbandonLoadTimeout:kb,retrieveManifest:Xa,addUTCTimingSource:Ya,removeUTCTimingSource:Za,clearDefaultUTCTimingSources:$a,restoreDefaultUTCTimingSources:_a,setBufferToKeep:bb,setBufferPruningInterval:cb,setStableBufferTime:db,setBufferTimeAtTopQuality:eb,setFragmentLoaderRetryAttempts:lb,setFragmentLoaderRetryInterval:mb,setBufferTimeAtTopQualityLongForm:fb,setLongFormContentDurationThreshold:gb,setRichBufferThreshold:hb,getProtectionController:nb,attachProtectionController:ob,setProtectionData:pb,enableManifestDateHeaderTimeSource:ab,displayCaptionsOnTop:qb,attachVideoContainer:sb,attachTTMLRenderingDiv:wb,reset:zb},a(),Ub}Object.defineProperty(c,"__esModule",{value:!0});var f=a("../dash/vo/UTCTiming.js"),g=d(f),h=a("./controllers/PlaybackController.js"),i=d(h),j=a("./controllers/StreamController.js"),k=d(j),l=a("./controllers/MediaController.js"),m=d(l),n=a("./ManifestLoader.js"),o=d(n),p=a("./utils/LiveEdgeFinder.js"),q=d(p),r=a("./utils/ErrorHandler.js"),s=d(r),t=a("./utils/Capabilities.js"),u=d(t),v=a("./TextTracks.js"),w=d(v),x=a("./controllers/SourceBufferController.js"),y=d(x),z=a("./VirtualBuffer.js"),A=d(z),B=a("./utils/RequestModifier.js"),C=d(B),D=a("./TextSourceBuffer.js"),E=d(D),F=a("./models/URIQueryAndFragmentModel.js"),G=d(F),H=a("./models/ManifestModel.js"),I=d(H),J=a("./models/MediaPlayerModel.js"),K=d(J),L=a("./models/MetricsModel.js"),M=d(L),N=a("./controllers/AbrController.js"),O=d(N),P=a("./controllers/TimeSyncController.js"),Q=d(P),R=a("./rules/abr/ABRRulesCollection.js"),S=d(R),T=a("./models/VideoModel.js"),U=d(T),V=a("./rules/RulesController.js"),W=d(V),X=a("./rules/synchronization/SynchronizationRulesCollection.js"),Y=d(X),Z=a("./controllers/MediaSourceController.js"),$=d(Z),_=a("./controllers/BaseURLController.js"),aa=d(_),ba=a("./../core/Debug.js"),ca=d(ba),da=a("./../core/EventBus.js"),ea=d(da),fa=a("./../core/events/Events.js"),ga=d(fa),ha=a("./MediaPlayerEvents.js"),ia=d(ha),ja=a("../core/FactoryMaker.js"),ka=d(ja),la=a("../dash/DashAdapter.js"),ma=d(la),na=a("../dash/DashParser.js"),oa=d(na),pa=a("../dash/models/DashManifestModel.js"),qa=d(pa),ra=a("../dash/DashMetrics.js"),sa=d(ra),ta=a("../dash/utils/TimelineConverter.js"),ua=d(ta);e.__dashjs_factory_name="MediaPlayer";var va=ka["default"].getClassFactory(e);va.events=ia["default"],c["default"]=va,b.exports=c["default"]},{"../core/FactoryMaker.js":9,"../dash/DashAdapter.js":13,"../dash/DashMetrics.js":15,"../dash/DashParser.js":16,"../dash/models/DashManifestModel.js":19,"../dash/utils/TimelineConverter.js":25,"../dash/vo/UTCTiming.js":35,"./../core/Debug.js":7,"./../core/EventBus.js":8,"./../core/events/Events.js":11,"./ManifestLoader.js":37,"./MediaPlayerEvents.js":40,"./TextSourceBuffer.js":44,"./TextTracks.js":45,"./VirtualBuffer.js":46,"./controllers/AbrController.js":49,"./controllers/BaseURLController.js":50,"./controllers/MediaController.js":55,"./controllers/MediaSourceController.js":56,"./controllers/PlaybackController.js":57,"./controllers/SourceBufferController.js":59,"./controllers/StreamController.js":60,"./controllers/TimeSyncController.js":62,"./models/ManifestModel.js":89,"./models/MediaPlayerModel.js":90,"./models/MetricsModel.js":91,"./models/URIQueryAndFragmentModel.js":92,"./models/VideoModel.js":93,"./rules/RulesController.js":118,"./rules/abr/ABRRulesCollection.js":120,"./rules/synchronization/SynchronizationRulesCollection.js":133,"./utils/Capabilities.js":136,"./utils/ErrorHandler.js":139,"./utils/LiveEdgeFinder.js":141,"./utils/RequestModifier.js":143}],40:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function f(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}Object.defineProperty(c,"__esModule",{value:!0});var g=function(a,b,c){for(var d=!0;d;){var e=a,f=b,g=c;d=!1,null===e&&(e=Function.prototype);var h=Object.getOwnPropertyDescriptor(e,f);if(void 0!==h){if("value"in h)return h.value;var i=h.get;if(void 0===i)return;return i.call(g)}var j=Object.getPrototypeOf(e);if(null===j)return;a=j,b=f,c=g,d=!0,h=j=void 0}},h=a("../core/events/EventsBase.js"),i=d(h),j=function(a){function b(){e(this,b),g(Object.getPrototypeOf(b.prototype),"constructor",this).call(this),this.BUFFER_EMPTY="bufferstalled",this.BUFFER_LOADED="bufferloaded",this.BUFFER_LEVEL_STATE_CHANGED="bufferStateChanged",this.ERROR="error",this.LOG="log",this.MANIFEST_LOADED="manifestloaded",this.METRICS_CHANGED="metricschanged",this.METRIC_CHANGED="metricchanged",this.METRIC_ADDED="metricadded",this.METRIC_UPDATED="metricupdated",this.PERIOD_SWITCH_COMPLETED="streamswitchcompleted",this.PERIOD_SWITCH_STARTED="streamswitchstarted",this.STREAM_INITIALIZED="streaminitialized",this.TEXT_TRACKS_ADDED="alltexttracksadded",this.TEXT_TRACK_ADDED="texttrackadded",this.CAN_PLAY="canPlay",this.PLAYBACK_ENDED="playbackEnded",this.PLAYBACK_ERROR="playbackError",this.PLAYBACK_METADATA_LOADED="playbackMetaDataLoaded",this.PLAYBACK_PAUSED="playbackPaused",this.PLAYBACK_PLAYING="playbackPlaying",this.PLAYBACK_PROGRESS="playbackProgress",this.PLAYBACK_RATE_CHANGED="playbackRateChanged",this.PLAYBACK_SEEKED="playbackSeeked",this.PLAYBACK_SEEKING="playbackSeeking",this.PLAYBACK_STARTED="playbackStarted",this.PLAYBACK_TIME_UPDATED="playbackTimeUpdated"}return f(b,a),b}(i["default"]),k=new j;c["default"]=k,b.exports=c["default"]},{"../core/events/EventsBase.js":12}],41:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(){function a(a,b,c){if(!a||"VIDEO"!==a.nodeName)return null;if(a._dashjs_player)return a._dashjs_player;var e,f=a.id||a.name||"video element";if(b=b||[].slice.call(a.querySelectorAll("source")).filter(function(a){return a.type==d})[0],!b&&a.src)b=document.createElement("source"),b.src=a.src;else if(!b&&!a.src)return null;return c=c||{},e=(0,h["default"])(c).create(),e.initialize(a,b.src,a.autoplay),e.getDebug().log("Converted "+f+" to dash.js player and added content: "+b.src),a._dashjs_player=e,e}function b(b,e){var f=[];b=b||"[data-dashjs-player]",e=e||document;for(var g=e.querySelectorAll(b),h=0;hb;b++)ha[b].reset();ha=[],ia=!1,ja=!1,x(),$.off(G["default"].CURRENT_TRACK_CHANGED,J,ga)}function f(){qa&&(qa.pause(),qa=null),sa&&(sa.reset(),sa=null),pa.abortSearch(),e(),ra=null,ua=null,aa=null,_=null,ba=null,ca=null,Z=null,da=null,ma=!1,na=!1,la={},$.off(G["default"].DATA_UPDATE_COMPLETED,T,ga),$.off(G["default"].BUFFERING_COMPLETED,S,ga),$.off(G["default"].KEY_ERROR,D,ga),$.off(G["default"].SERVER_CERTIFICATE_UPDATED,D,ga),$.off(G["default"].LICENSE_REQUEST_COMPLETE,D,ga),$.off(G["default"].KEY_SYSTEM_SELECTED,D,ga),$.off(G["default"].KEY_SESSION_CREATED,D,ga)}function h(){return ka.duration}function j(){return ka.start}function l(){return ka.index}function n(){return ka.id}function p(){return ka}function r(a){return null!==Q(a)}function t(a){var b=Q(a);return ua.getBitrateList(b)}function v(){ta&&ta.start()}function x(){ta&&ta.clear()}function z(){return ia}function B(){return na}function D(a){a.error&&(da.mediaKeySessionError(a.error),Z(a.error),f())}function F(a){return"text"===a.type?a.mimeType:a.type}function H(a,b,c){var d,e,f=a.type;if("muxed"===f&&a)return e="Multiplexed representations are intentionally not supported, as they are not compliant with the DASH-AVC/264 guidelines",Z(e),da.manifestError(e,"multiplexedrep",_.getValue()),!1;if("text"===f||"fragmentedText"===f||"embeddedText"===f)return!0;if(d=a.codec,Z(f+" codec: "+d),a.contentProtection&&!ca.supportsEncryptedMedia())da.capabilityError("encryptedmedia");else if(!ca.supportsCodec((0,s["default"])(Y).getInstance().getElement(),d))return e=f+"Codec ("+d+") is not supported.",da.manifestError(e,"codec",c),Z(e),!1;return!0}function J(a){if(a.newMediaInfo.streamInfo.id===ka.id){var b=U(a.oldMediaInfo);if(b){var c=qa.getTime(),d=b.getBuffer(),e=a.newMediaInfo,f=_.getValue(),g=ha.indexOf(b),h=b.getMediaSource();"fragmentedText"!==e.type?(b.reset(!0),L(e,f,h,{buffer:d,replaceIdx:g,currentTime:c}),qa.seek(qa.getTime())):b.updateMediaInfo(f,e)}}}function K(){var a=(0,A["default"])(Y).getInstance();a.setConfig({baseURLController:fa}),a.initialize();var b=(0,y["default"])(Y).create({segmentBaseLoader:a,timelineConverter:ea,dashMetrics:(0,C["default"])(Y).getInstance(),metricsModel:(0,u["default"])(Y).getInstance(),baseURLController:fa});return b}function L(a,b,c,d){var e=(0,i["default"])(Y).create({indexHandler:K(),timelineConverter:ea,adapter:ba,manifestModel:_}),f=ba.getAllMediaInfoForType(b,ka,a.type);if(e.initialize(F(a),sa,c,ga,ta),ua.updateTopQualityIndex(a),d?(e.setBuffer(d.buffer),ha[d.replaceIdx]=e):ha.push(e),"text"===a.type||"fragmentedText"===a.type){for(var g,h=0;hg;g++)if(f=e[g],"embeddedText"===a)va.addEmbeddedTrack(f);else{if(!H(f,b,d))continue;ra.isMultiTrackSupportedByType(f.type)&&ra.addTrack(f,ka)}"embeddedText"!==a&&0!==ra.getTracksFor(a,ka).length&&(ra.checkInitialMediaSettingsForType(a,ka),c=ra.getCurrentTrackFor(a,ka),L(c,d,b))}function O(a){var b,c=_.getValue();if(ta=(0,m["default"])(Y).getInstance(),ta.initialize(),ta.setConfig({manifestModel:_,manifestUpdater:aa}),b=ba.getEventsFor(c,ka),ta.addInlineEvents(b),ma=!0,N("video",a),N("audio",a),N("text",a),N("fragmentedText",a),N("embeddedText",a),N("muxed",a),R(),ja=!0,ma=!1,0===ha.length){var d="No streams to play.";da.manifestError(d,"nostreams",c),Z(d)}else pa.initialize(ea,ha[0]),P()}function P(){var a=ha.length,b=!!la.audio||!!la.video,c=b?new Error(X,"Data update failed",null):null,d=0;for(d;a>d;d++)if(ha[d].isUpdating()||ma)return;na=!0,ia=!0,ja&&(oa&&oa.initialize(_.getValue(),Q("audio"),Q("video")),$.trigger(G["default"].STREAM_INITIALIZED,{streamInfo:ka,error:c}))}function Q(a){for(var b=ha.length,c=null,d=0;b>d;d++)if(c=ha[d],c.getType()===a)return c.getMediaInfo();return null}function R(){for(var a=0,b=ha.length;b>a;a++)ha[a].createBuffer()}function S(a){if(a.streamInfo===ka){var b=V(),c=b.length,d=0;for(d;c>d;d++)if(!b[d].isBufferingCompleted())return;$.trigger(G["default"].STREAM_BUFFERING_COMPLETED,{streamInfo:ka})}}function T(a){var b=a.sender.getStreamProcessor();b.getStreamInfo()===ka&&(la[b.getType()]=a.error,P())}function U(a){if(!a)return!1;var b=V();return b.filter(function(b){return b.getType()===a.type})[0]}function V(){var a,b,c=ha.length,d=[],e=0;for(e;c>e;e++)b=ha[e],a=b.getType(),("audio"===a||"video"===a||"fragmentedText"===a)&&d.push(b);return d}function W(a){var b,c,d,e=ha.length,f=_.getValue(),g=0;for(ia=!1,ka=a,Z("Manifest updated... set new data on buffers."),ta&&(c=ba.getEventsFor(f,ka),ta.addInlineEvents(c)),ma=!0,na=!1,g;e>g;g++)d=ha[g],b=ba.getMediaInfoForType(f,ka,d.getType()),ua.updateTopQualityIndex(b),d.updateMediaInfo(f,b);ma=!1,P()}var X=1,Y=this.context,Z=(0,I["default"])(Y).getInstance().log,$=(0,E["default"])(Y).getInstance(),_=a.manifestModel,aa=a.manifestUpdater,ba=a.adapter,ca=a.capabilities,da=a.errHandler,ea=a.timelineConverter,fa=a.baseURLController,ga=void 0,ha=void 0,ia=void 0,ja=void 0,ka=void 0,la=void 0,ma=void 0,na=void 0,oa=void 0,pa=void 0,qa=void 0,ra=void 0,sa=void 0,ta=void 0,ua=void 0,va=void 0;return ga={initialize:c,activate:d,deactivate:e,getDuration:h,getStartTime:j,getStreamIndex:l,getId:n,getStreamInfo:p,hasMedia:r,getBitrateListFor:t,startEventController:v,isActivated:z,isInitialized:B,updateData:W,reset:f,getProcessors:V},b(),ga}Object.defineProperty(c,"__esModule",{value:!0});var f=a("./utils/LiveEdgeFinder.js"),g=d(f),h=a("./StreamProcessor.js"),i=d(h),j=a("./controllers/MediaController.js"),k=d(j),l=a("./controllers/EventController.js"),m=d(l),n=a("./controllers/FragmentController.js"),o=d(n),p=a("./controllers/AbrController.js"),q=d(p),r=a("./models/VideoModel.js"),s=d(r),t=a("./models/MetricsModel.js"),u=d(t),v=a("./controllers/PlaybackController.js"),w=d(v),x=a("../dash/DashHandler.js"),y=d(x),z=a("../dash/SegmentBaseLoader.js"),A=d(z),B=a("../dash/DashMetrics.js"),C=d(B),D=a("../core/EventBus.js"),E=d(D),F=a("../core/events/Events.js"),G=d(F),H=a("../core/Debug.js"),I=d(H),J=a("../core/FactoryMaker.js"),K=d(J),L=a("./TextSourceBuffer.js"),M=d(L);e.__dashjs_factory_name="Stream",c["default"]=K["default"].getClassFactory(e),b.exports=c["default"]},{"../core/Debug.js":7,"../core/EventBus.js":8,"../core/FactoryMaker.js":9,"../core/events/Events.js":11,"../dash/DashHandler.js":14,"../dash/DashMetrics.js":15,"../dash/SegmentBaseLoader.js":17,"./StreamProcessor.js":43,"./TextSourceBuffer.js":44,"./controllers/AbrController.js":49,"./controllers/EventController.js":53,"./controllers/FragmentController.js":54,"./controllers/MediaController.js":55,"./controllers/PlaybackController.js":57,"./models/MetricsModel.js":91,"./models/VideoModel.js":93,"./utils/LiveEdgeFinder.js":141}],43:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a){function b(){ea=[]}function c(a,b,c,d,e){da=a,fa=d,ga=e,la=b,ba=fa.getStreamInfo().manifestInfo.isDynamic,Y.initialize(this),ha=(0,g["default"])(X).getInstance(),ha.initialize(da,this),ia=W(a),ia.initialize(da,c,this),ja=(0,q["default"])(X).create({metricsModel:(0,w["default"])(X).getInstance(),manifestModel:_,adapter:$,dashMetrics:(0,M["default"])(X).getInstance(),dashManifestModel:(0,K["default"])(X).getInstance(),timelineConverter:Z,rulesController:(0,s["default"])(X).getInstance(),mediaPlayerModel:(0,u["default"])(X).getInstance()}),ja.initialize(da,this),ma=(0,y["default"])(X).create({metricsModel:(0,w["default"])(X).getInstance(),errHandler:(0,Q["default"])(X).getInstance(),requestModifier:(0,A["default"])(X).getInstance()}),ka=(0,O["default"])(X).create(),ka.initialize(this),na=ja.getFragmentModel(),na.setLoader(ma)}function d(a){na&&(na.reset(),na=null),Y.reset(),ia&&(ia.reset(a),ia=null),ja&&(ja.reset(),ja=null),ka&&(ka.reset(),ka=null),la=null,ma=null,ga=null,fa=null,ba=null,ca=null,ea=[],da=null}function e(){return ka.isUpdating()}function f(){return da}function h(){return ha}function j(){return ka}function l(){return ma}function n(){return Y}function p(){return la}function r(){return ia.getBuffer()}function t(a){ia.setBuffer(a)}function v(){return ia}function x(){return na}function z(){return fa.getStreamInfo()}function B(a,b){b===ca||b&&ca&&b.type!==ca.type||(ca=b),-1===ea.indexOf(b)&&ea.push(b),$.updateData(a,this)}function D(){return ea}function F(){return ca}function H(){return ia.getMediaSource()}function J(){return ja}function L(){return ga}function N(){ja.start()}function P(){ja.stop()}function R(){return $.getCurrentRepresentationInfo(_.getValue(),ka)}function S(a){return $.getRepresentationInfoForQuality(_.getValue(),ka,a)}function T(){return ia.getIsBufferingCompleted()}function U(){return ia.getBuffer()||ia.createBuffer(ca)}function V(){return ba}function W(a){var b=null;return b="video"===a||"audio"===a||"fragmentedText"===a?(0,i["default"])(X).create({metricsModel:(0,w["default"])(X).getInstance(),manifestModel:_,sourceBufferController:(0,C["default"])(X).getInstance(),errHandler:(0,Q["default"])(X).getInstance(),mediaSourceController:(0,I["default"])(X).getInstance(),streamController:(0,k["default"])(X).getInstance(),mediaController:(0,m["default"])(X).getInstance(),adapter:$,virtualBuffer:(0,G["default"])(X).getInstance(),textSourceBuffer:(0,E["default"])(X).getInstance()}):(0,o["default"])(X).create({errHandler:(0,Q["default"])(X).getInstance(),sourceBufferController:(0,C["default"])(X).getInstance()})}var X=this.context,Y=a.indexHandler,Z=a.timelineConverter,$=a.adapter,_=a.manifestModel,aa=void 0,ba=void 0,ca=void 0,da=void 0,ea=void 0,fa=void 0,ga=void 0,ha=void 0,ia=void 0,ja=void 0,ka=void 0,la=void 0,ma=void 0,na=void 0;return aa={initialize:c,isUpdating:e,getType:f,getBufferController:v,getABRController:h,getFragmentLoader:l,getFragmentModel:x,getScheduleController:J,getEventController:L,getFragmentController:p,getRepresentationController:j,getIndexHandler:n,getCurrentRepresentationInfo:R,getRepresentationInfoForQuality:S,isBufferingCompleted:T,createBuffer:U,getStreamInfo:z,updateMediaInfo:B,getMediaInfoArr:D,getMediaInfo:F,getMediaSource:H,getBuffer:r,setBuffer:t,start:N,stop:P,isDynamic:V,reset:d},b(),aa}Object.defineProperty(c,"__esModule",{value:!0});var f=a("./controllers/AbrController.js"),g=d(f),h=a("./controllers/BufferController.js"),i=d(h),j=a("./controllers/StreamController.js"),k=d(j),l=a("./controllers/MediaController.js"),m=d(l),n=a("./controllers/TextController.js"),o=d(n),p=a("./controllers/ScheduleController.js"),q=d(p),r=a("./rules/RulesController.js"),s=d(r),t=a("./models/MediaPlayerModel.js"),u=d(t),v=a("./models/MetricsModel.js"),w=d(v),x=a("./FragmentLoader.js"),y=d(x),z=a("./utils/RequestModifier.js"),A=d(z),B=a("./controllers/SourceBufferController"),C=d(B),D=a("./TextSourceBuffer.js"),E=d(D),F=a("./VirtualBuffer.js"),G=d(F),H=a("./controllers/MediaSourceController.js"),I=d(H),J=a("../dash/models/DashManifestModel.js"),K=d(J),L=a("../dash/DashMetrics.js"),M=d(L),N=a("../dash/controllers/RepresentationController.js"),O=d(N),P=a("./utils/ErrorHandler.js"),Q=d(P),R=a("../core/FactoryMaker.js"),S=d(R);e.__dashjs_factory_name="StreamProcessor",c["default"]=S["default"].getClassFactory(e),b.exports=c["default"]},{"../core/FactoryMaker.js":9,"../dash/DashMetrics.js":15,"../dash/controllers/RepresentationController.js":18,"../dash/models/DashManifestModel.js":19,"./FragmentLoader.js":36,"./TextSourceBuffer.js":44,"./VirtualBuffer.js":46,"./controllers/AbrController.js":49,"./controllers/BufferController.js":52,"./controllers/MediaController.js":55,"./controllers/MediaSourceController.js":56,"./controllers/ScheduleController.js":58,"./controllers/SourceBufferController":59,"./controllers/StreamController.js":60,"./controllers/TextController.js":61,"./models/MediaPlayerModel.js":90,"./models/MetricsModel.js":91,"./rules/RulesController.js":118,"./utils/ErrorHandler.js":139,"./utils/RequestModifier.js":143}],44:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(){function a(a,c){M=!1,N=null,U=null,V=!1,W=NaN,X=[],$=null,E||b();var d=c.getStreamProcessor();if(R=d.getMediaInfoArr(),S.setConfig({videoModel:Y}),S.initialize(),T=!K.getIsTextTrack(a),H=(0,k["default"])(C).getInstance(),Q=(0,i["default"])(C).getInstance(),Q.setConfig({boxParser:H}),T){U=d.getFragmentModel(),this.buffered=(0,m["default"])(C).create(),X=L.getTracksFor("fragmentedText",Z.getActiveStreamInfo());for(var e=L.getCurrentTrackFor("fragmentedText",Z.getActiveStreamInfo()),f=0;f0?d[b.roles[0]]:d.caption;return a=a===d.caption||a===d.subtitle?a:d.caption},f=function(){var a=!1;return b.codec&&b.codec.search("stpp")>=0&&(a=!0),b.mimeType&&b.mimeType.search("ttml")>=0&&(a=!0),a};c.captionData=a,c.lang=b.lang,c.label=b.id,c.index=b.index,c.isTTML=f(),c.video=Y.getElement(),c.defaultTrack=A(b),c.isFragmented=T,c.isEmbedded=b.isEmbedded?!0:!1,c.kind=e();var h=(R?R.length:0)+aa.length;S.addTextTrack(c,h)}var e,f,h,i,j,k=b.mediaInfo,l=k.type,m=k.mimeType,n=k.codec||m;if(!n)return void D("No text type defined");if("fragmentedText"===l)if(V)if(i=Q.getSamplesInfo(a),f=i.sampleList,!$&&f.length>0&&($=f[0].cts-b.start*W),n.search("stpp")>=0)for(N=null!==N?N:B(n),h=0;h0&&S.addCaptions(_,0,u)}else{for(V=!0,h=0;h0){if(b>=a[d-1][0])a.push([b,c]);else for(var e=d-1;e>=0;e--)if(b1&&D("Warning: Too many truns");for(var h=d.offset+g.data_offset,i=g.sample_count,j=h,k=e.baseMediaDecodeTime,l=new DataView(a),m={startTime:null,endTime:null,fields:[[],[]]},n=0,o=0;i>o;o++){for(var p=g.samples[o],q=k+n+p.sample_composition_time_offset,r=y["default"].findCea608Nalus(l,j,p.sample_size),s=0;su;u++)t[u].length>0&&b(m.fields[u],q,t[u]);n+=p.sample_duration,j+=p.sample_size}var v=k+n;return m.startTime=k,m.endTime=v,m}function e(a){for(var b="",c=0;cs;++s){var u=d.rows[s],v="",w=null;if(!1===u.isEmpty()){var x=e(u.chars);null===g&&(g={x:x,y1:s,y2:s+1,p:[]}),x!==k&&i&&(g.p.push(m),m={start:b,end:c,spans:[]},g.y2=s,g.name="region_"+g.x+"_"+g.y1+"_"+g.y2,!1===p.hasOwnProperty(g.name)?(r.push(g),p[g.name]=g):(h=p[g.name],h.p.contat(g.p)),g={x:x,y1:s,y2:s+1,p:[]});for(var y=0;y0&&(m.spans.push({name:o,line:v,row:s}),v="");var B="style_cea608_"+A.foreground+"_"+A.background;A.underline&&(B+="_underline"),A.italics&&(B+="_italics"),q.hasOwnProperty(B)||(q[B]=JSON.parse(JSON.stringify(A))),w=A,o=B}v+=z.uchar}v.trim().length>0&&m.spans.push({name:o,line:v,row:s}),i=!0,k=x}else i=!1,k=-1,g&&(g.p.push(m),m={start:b,end:c,spans:[]},g.y2=s,g.name="region_"+g.x+"_"+g.y1+"_"+g.y2,!1===p.hasOwnProperty(g.name)?(r.push(g),p[g.name]=g):(h=p[g.name],h.p.contat(g.p)),g=null)}g&&(g.p.push(m),g.y2=s+1,g.name="region_"+g.x+"_"+g.y1+"_"+g.y2,!1===p.hasOwnProperty(g.name)?(r.push(g),p[g.name]=g):(h=p[g.name],h.p.contat(g.p)),g=null);var C=[];for(s=0;s0){if(0!==t&&M!=N.row){var O=document.createElement("br");O.className="lineBreak",J.appendChild(O)}var P=!1;M===N.row&&(P=!0),M=N.row;var Q=q[N.name],R=document.createElement("span");R.className="spanPadding "+N.name+" customSpanColor",R.style.cssText=j(a,Q),0!==t&&P?t===L.spans.length-1?R.textContent=n(N.line):R.textContent=N.line:0===t&&L.spans.length>1&&N.row===L.spans[1].row?R.textContent=l(N.line):R.textContent=N.line.trim(),J.appendChild(R)}}}I.appendChild(J),G.appendChild(I);var S={bodyStyle:90};for(t in q)q.hasOwnProperty(t)&&(S[t]=90);C.push({type:"html",start:b,end:c,cueHTMLElement:G,cueID:E,cellResolution:[32,15],isFromCEA608:!0,regions:r,regionID:D.name,videoHeight:a.videoHeight,videoWidth:a.videoWidth,fontSize:S||{defaultFontSize:"100"},lineHeight:{},linePadding:{}})}return C}function p(){S.deleteAllTextTracks(),M=!1,N=null,Q=null,R=null,S=null,T=!1,U=null,V=!1,W=NaN,X=[],Y=null,Z=null,E=!1,aa=null}function r(a){E||b(),"CC1"===a.id||"CC3"===a.id?aa.push(a):D("Warning: Embedded track "+a.id+" not supported!")}function t(){E=!1,aa=[],fa=[null,null],ea=[],da=null}function v(){return M}function x(a){a&&(a.errHandler&&(I=a.errHandler), +a.adapter&&(J=a.adapter),a.dashManifestModel&&(K=a.dashManifestModel),a.mediaController&&(L=a.mediaController),a.videoModel&&(Y=a.videoModel),a.streamController&&(Z=a.streamController),a.textTracks&&(S=a.textTracks),a.VTTParser&&(O=a.VTTParser),a.TTMLParser&&(P=a.TTMLParser))}function z(){for(var a=Y.getElement(),b=a.textTracks,c=b.length,d=c-aa.length,e=S.getCurrentTrackIdx(),f=0;c>f;f++){var g=b[f];if(M="showing"!==g.mode,"showing"===g.mode){if(e!==f&&(S.setCurrentTrackIdx(f),S.addCaptions(f,0,null),T&&d>f)){var h=L.getCurrentTrackFor("fragmentedText",Z.getActiveStreamInfo()),i=X[f];i!==h&&(U.abortRequests(),S.deleteTrackCues(h),L.setTrack(i),_=f)}break}}M&&S.setCurrentTrackIdx(-1)}function A(a){var b=!1;return aa.length>1?b=a.id&&"CC1"===a.id:1===aa.length?a.id&&"CC"===a.id.substring(0,2)&&(b=!0):b=a.index===R[0].index,b}function B(a){var b;return a.search("vtt")>=0?b=O:(a.search("ttml")>=0||a.search("stpp")>=0)&&(b=P,b.setConfig({videoModel:Y})),b}var C=this.context,D=(0,q["default"])(C).getInstance().log,E=!1,F=0,G=void 0,H=void 0,I=void 0,J=void 0,K=void 0,L=void 0,M=void 0,N=void 0,O=void 0,P=void 0,Q=void 0,R=void 0,S=void 0,T=void 0,U=void 0,V=void 0,W=void 0,X=void 0,Y=void 0,Z=void 0,$=void 0,_=void 0,aa=void 0,ba=void 0,ca=void 0,da=void 0,ea=void 0,fa=void 0;return G={initialize:a,append:c,abort:p,getAllTracksAreDisabled:v,setTextTrack:z,setConfig:x,addEmbeddedTrack:r,resetEmbedded:t}}Object.defineProperty(c,"__esModule",{value:!0});var f=a("./vo/TextTrackInfo.js"),g=d(f),h=a("../dash/utils/FragmentedTextBoxParser.js"),i=d(h),j=a("./utils/BoxParser.js"),k=d(j),l=a("./utils/CustomTimeRanges.js"),m=d(l),n=a("../core/FactoryMaker.js"),o=d(n),p=a("../core/Debug.js"),q=d(p),r=a("./models/VideoModel.js"),s=d(r),t=a("./TextTracks.js"),u=d(t),v=a("codem-isoboxer"),w=d(v),x=a("../../externals/cea608-parser.js"),y=d(x);e.__dashjs_factory_name="TextSourceBuffer",c["default"]=o["default"].getSingletonFactory(e),b.exports=c["default"]},{"../../externals/cea608-parser.js":2,"../core/Debug.js":7,"../core/FactoryMaker.js":9,"../dash/utils/FragmentedTextBoxParser.js":20,"./TextTracks.js":45,"./models/VideoModel.js":93,"./utils/BoxParser.js":135,"./utils/CustomTimeRanges.js":137,"./vo/TextTrackInfo.js":158,"codem-isoboxer":6}],45:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(){function a(){B=window.VTTCue||window.TextTrackCue,E=[],F=[],G=-1,H=0,I=0,J=0,K=0,L=null,M=null,P=!1,Q=2147483647,N=!!navigator.userAgent.match(/Chrome/)&&!navigator.userAgent.match(/Edge/),void 0!==document.fullscreenElement?O="fullscreenElement":void 0!==document.webkitIsFullScreen?O="webkitIsFullScreen":document.msFullscreenElement?O="msFullscreenElement":document.mozFullScreen&&(O="mozFullScreen")}function b(a){var b=E[a].kind,c=void 0!==E[a].label?E[a].label:E[a].lang,d=E[a].lang,e=N?document.createElement("track"):D.addTextTrack(b,c,d);return N&&(e.kind=b,e.label=c,e.srclang=d),e}function c(a){P=a,L&&!document[O]&&(L.style.zIndex=a?Q:null)}function d(a,c){if(E.length===c)return void z("Trying to add too many tracks.");if(E.push(a),void 0===D&&(D=a.video),E.length===c){E.sort(function(a,b){return a.index-b.index}),L=C.getTTMLRenderingDiv();for(var d=-1,e=0;e=0&&(D.textTracks[d].mode="showing",this.addCaptions(d,0,null)),y.trigger(i["default"].TEXT_TRACKS_ADDED,{index:G,tracks:E})}}function e(a,b,c,d,e,f){var g=a/b,h=c/d,i=0,j=0,k=0,l=0;g>h?(l=b,k=l/d*c,i=(a-k)/2,j=0):(k=a,l=k/c*d,i=0,j=(b-l)/2);var m=0,n=0,o=0,p=0,q=k/l;return q>e?(p=l,o=l/(1/e),m=(a-o)/2,n=0):(o=k,p=k/e,m=0,n=(b-p)/2),f?{x:m+.1*o,y:n+.1*p,w:.8*o,h:.8*p}:{x:m,y:n,w:o,h:p}}function f(){var a=this.getCurrentTextTrack();if(a&&"html"===a.renderingType){var b=1;a.cellResolution&&(b=a.cellResolution[0]/a.cellResolution[1]);var c=!1;a.isFromCEA608&&(b=3.5/3,c=!0);var d=e.call(this,D.clientWidth,D.clientHeight,D.videoWidth,D.videoHeight,b,c),f=d.w,g=d.h;if(f!=J||g!=K){H=d.x,I=d.y,J=f,K=g,L.style.left=H+"px",L.style.top=I+"px",L.style.width=J+"px",L.style.height=K+"px";for(var h=0;a.activeCues&&h=0?D.textTracks[a]:null,e=this;if(d){if("showing"!==d.mode)return void(c&&c.length>0&&(d.nonAddedCues=d.nonAddedCues.concat(c)));if(c||(c=d.nonAddedCues,d.nonAddedCues=[]),c&&0!==c.length)for(var g in c){var i,j=c[g];d.cellResolution=j.cellResolution,d.isFromCEA608=j.isFromCEA608,M||"html"!=j.type||(M=setInterval(f.bind(this),500)),"image"==j.type?(i=new B(j.start-b,j.end-b,""),i.image=j.data,i.id=j.id,i.size=0,i.type="image",i.onenter=function(){var a=new Image;a.id="ttmlImage_"+this.id,a.src=this.image,a.className="cue-image",L?L.appendChild(a):D.parentNode.appendChild(a)},i.onexit=function(){var a,b,c;for(a=L?L:D.parentNode,c=a.childNodes,b=0;b=0?D.textTracks[G]:null}function l(){return G}function n(a){for(var b=-1,c=0;c=0){var b=D.textTracks[a];"html"===b.renderingType?t.call(this):u.call(this)}else u.call(this)}function p(a){return D.textTracks[a]}function q(a){if(a.cues){for(var b=a.cues,c=b.length-1,d=c;d>=0;d--)a.removeCue(b[d]);a.mode="disabled"}}function r(){for(var a=F.length,b=0;a>b;b++)if(N)D.removeChild(F[b]);else{var c=p.call(this,b);c.nonAddedCues=[],q.call(this,c)}F=[],E=[],M&&(clearInterval(M),M=null),v.call(this)}function s(a){D.removeChild(F[a]),F.splice(a,1)}function t(){if(N){var a=document.getElementById("native-cue-style");if(!a){a=document.createElement("style"),a.id="native-cue-style",document.head.appendChild(a);var b=a.sheet;D.id?b.insertRule("#"+D.id+"::cue {background: transparent}",0):0!==D.classList.length?b.insertRule("."+D.className+"::cue {background: transparent}",0):b.insertRule("video::cue {background: transparent}",0)}}}function u(){if(N){var a=document.getElementById("native-cue-style");a&&document.head.removeChild(a)}}function v(){if(L)for(;L.firstChild;)L.removeChild(L.firstChild)}function w(a){a&&a.videoModel&&(C=a.videoModel)}var x=this.context,y=(0,g["default"])(x).getInstance(),z=(0,m["default"])(x).getInstance().log,A=void 0,B=void 0,C=void 0,D=void 0,E=void 0,F=void 0,G=void 0,H=void 0,I=void 0,J=void 0,K=void 0,L=void 0,M=void 0,N=void 0,O=void 0,P=void 0,Q=void 0;return A={initialize:a,displayCConTop:c,addTextTrack:d,addCaptions:j,getTextTrack:p,getCurrentTextTrack:k,getCurrentTrackIdx:l,setCurrentTrackIdx:o,getTrackIdxForId:n,deleteTrackCues:q,deleteAllTextTracks:r,deleteTextTrack:s,setConfig:w}}Object.defineProperty(c,"__esModule",{value:!0});var f=a("../core/EventBus.js"),g=d(f),h=a("../core/events/Events.js"),i=d(h),j=a("../core/FactoryMaker.js"),k=d(j),l=a("../core/Debug.js"),m=d(l);e.__dashjs_factory_name="TextTracks",c["default"]=k["default"].getSingletonFactory(e),b.exports=c["default"]},{"../core/Debug.js":7,"../core/EventBus.js":8,"../core/FactoryMaker.js":9,"../core/events/Events.js":11}],46:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(){function a(){v={}}function b(a){var b=a.streamId,c=a.mediaInfo.type,d=a.segmentType,e=a.start,f=a.end;v[b]=v[b]||r(),v[b][c][d].push(a),n(v[b][c][d],"index"),isNaN(e)||isNaN(f)||(v[b][c].calculatedBufferedRanges.add(e,f),t.trigger(o["default"].CHUNK_APPENDED,{chunk:a,sender:this}))}function c(a,b){if(a&&b){var c,d,f=a.streamId,g=a.mediaInfo.type,h=v[f][g].actualBufferedRanges,i=e({streamId:f,mediaType:g,appended:!0,start:a.start})[0];if(i?(d=v[f][g].appended.indexOf(i),v[f][g].appended[d]=a):v[f][g].appended.push(a),n(v[f][g].appended,"start"),c=w.getRangeDifference(h,b),!c)return void(i?a.bufferedRange=i.bufferedRange:a.bufferedRange={start:a.start,end:a.end});a.bufferedRange=c,h.add(c.start,c.end),i&&(a.bufferedRange.start=Math.min(i.bufferedRange.start,c.start),a.bufferedRange.end=Math.max(i.bufferedRange.end,c.end))}}function d(a,b){if(a){var c,d,f=a.streamId,g=a.mediaType,h=e({streamId:f,mediaType:g,appended:!0}),j=[];if(v[f][g].actualBufferedRanges=(0,i["default"])(s).create(),!b||0===b.length)return void(v[f][g].appended=[]);for(var k=0,l=b.length;l>k;k++)c=b.start(k),d=b.end(k),v[f][g].actualBufferedRanges.add(c,d),j=j.concat(q(h,{start:c,end:d},!0));v[f][g].appended=j}}function e(a){var b,c=p(a),d=a.segmentType,e=a.appended,f=a.removeOrigin,h=a.limit||Number.POSITIVE_INFINITY,i=(0,g["default"])(s).getInstance(),j=0,k=[];return c?(delete a.streamId,delete a.mediaType,delete a.segmentType,delete a.removeOrigin,delete a.limit,delete a.appended,b=e?c.appended:d?c[d]:[],k=b.filter(function(b,d,e){if(j>=h)return!1;for(var g in a){if("mediaInfo"===g)return i.isTracksEqual(b[g],a[g]);if(a.hasOwnProperty(g)&&b[g]!=a[g])return!1}return f&&(c.calculatedBufferedRanges.remove(b.start,b.end),e.splice(d,1)),j++,!0}),a.forRange&&(k=q(k,a.forRange,!1)),k):k}function f(a){return a.removeOrigin=!0,e(a)}function h(a){var b=a.type,c=0;for(var d in v)v.hasOwnProperty(d)&&(c+=w.getTotalBufferedTime({buffered:v[d][b].calculatedBufferedRanges}));return c}function j(a){a&&a.sourceBufferController&&(w=a.sourceBufferController)}function l(){v={}}function n(a,b){var c=function(a,c){return a[b]c[b]?1:0};a.sort(c)}function p(a){var b=a.streamId,c=a.mediaType;return v[b]?v[b][c]:null}function q(a,b,c){var d,e,f,g,h=b.start,i=b.end,j=[];return a.forEach(function(a){d=a.bufferedRange.start,e=a.bufferedRange.end,f=d>=h&&i>d,g=e>h&&i>=e,(f||g)&&(j.push(a),c&&(a.bufferedRange.start=f?d:h,a.bufferedRange.end=g?e:i))}),j}function r(){var a={};return a.audio={calculatedBufferedRanges:(0,i["default"])(s).create(),actualBufferedRanges:(0,i["default"])(s).create(),appended:[]},a.audio[k["default"].MEDIA_SEGMENT_TYPE]=[],a.audio[k["default"].INIT_SEGMENT_TYPE]=[],a.video={calculatedBufferedRanges:(0,i["default"])(s).create(),actualBufferedRanges:(0,i["default"])(s).create(),appended:[]},a.video[k["default"].MEDIA_SEGMENT_TYPE]=[],a.video[k["default"].INIT_SEGMENT_TYPE]=[],a.fragmentedText={calculatedBufferedRanges:(0,i["default"])(s).create(),actualBufferedRanges:(0,i["default"])(s).create(),appended:[]},a.fragmentedText[k["default"].MEDIA_SEGMENT_TYPE]=[],a.fragmentedText[k["default"].INIT_SEGMENT_TYPE]=[],a}var s=this.context,t=(0,m["default"])(s).getInstance(),u=void 0,v=void 0,w=void 0;return u={append:b,extract:f,getChunks:e,storeAppendedChunk:c,updateBufferedRanges:d,getTotalBufferLevel:h,setConfig:j,reset:l},a(),u}Object.defineProperty(c,"__esModule",{value:!0});var f=a("./controllers/MediaController.js"),g=d(f),h=a("./utils/CustomTimeRanges.js"),i=d(h),j=a("./vo/metrics/HTTPRequest.js"),k=d(j),l=a("../core/EventBus.js"),m=d(l),n=a("../core/events/Events.js"),o=d(n),p=a("../core/FactoryMaker.js"),q=d(p);e.__dashjs_factory_name="VirtualBuffer",c["default"]=q["default"].getSingletonFactory(e),b.exports=c["default"]},{"../core/EventBus.js":8,"../core/FactoryMaker.js":9,"../core/events/Events.js":11,"./controllers/MediaController.js":55,"./utils/CustomTimeRanges.js":137,"./vo/metrics/HTTPRequest.js":166}],47:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a,b,c){return b in a?Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0}):a[b]=c,a}function f(a){function b(){var a;o=[],p=[],q=[],a={},e(a,h["default"].MPD_TYPE,j.DOWNLOAD_ERROR_ID_MANIFEST),e(a,h["default"].XLINK_EXPANSION_TYPE,j.DOWNLOAD_ERROR_ID_XLINK),e(a,h["default"].INIT_SEGMENT_TYPE,j.DOWNLOAD_ERROR_ID_CONTENT),e(a,h["default"].MEDIA_SEGMENT_TYPE,j.DOWNLOAD_ERROR_ID_CONTENT),e(a,h["default"].INDEX_SEGMENT_TYPE,j.DOWNLOAD_ERROR_ID_CONTENT),e(a,h["default"].BITSTREAM_SWITCHING_SEGMENT_TYPE,j.DOWNLOAD_ERROR_ID_CONTENT),e(a,h["default"].OTHER_TYPE,j.DOWNLOAD_ERROR_ID_CONTENT),r=a}function c(a,b){var d=a.request,e=new XMLHttpRequest,f=[],g=!0,h=!0,l=new Date,n=l,s=0,t=function(a){h=!1,d.requestStartDate=l,d.requestEndDate=new Date,d.firstByteDate=d.firstByteDate||l,d.checkExistenceOnly||k.addHttpRequest(d.mediaType,null,d.type,d.url,e.responseURL||null,d.serviceLocation||null,d.range||null,d.requestStartDate,d.firstByteDate,d.requestEndDate,e.status,d.duration,e.getAllResponseHeaders(),a?f:null)},u=function(){-1!==o.indexOf(e)&&(o.splice(o.indexOf(e),1),h&&(t(!1),b>0?(b--,q.push(setTimeout(function(){c(a,b)},i.getRetryIntervalForType(d.type)))):(j.downloadError(r[d.type],d.url,d),a.error&&a.error(d,"error",e.statusText),a.complete&&a.complete(d,e.statusText))))},v=function(b){var c=new Date;g&&(g=!1,(!b.lengthComputable||b.lengthComputable&&b.total!==b.loaded)&&(d.firstByteDate=c)),b.lengthComputable&&(d.bytesLoaded=b.loaded,d.bytesTotal=b.total),f.push({s:n,d:c.getTime()-n.getTime(),b:[b.loaded?b.loaded-s:0]}),n=c,s=b.loaded,a.progress&&a.progress()},w=function(){e.status>=200&&e.status<=299&&(t(!0),a.success&&a.success(e.response,e.statusText,e),a.complete&&a.complete(d,e.statusText))};try{var x=m.modifyRequestURL(d.url),y=d.checkExistenceOnly?"HEAD":"GET";e.open(y,x,!0),d.responseType&&(e.responseType=d.responseType),d.range&&e.setRequestHeader("Range","bytes="+d.range),d.requestStartDate||(d.requestStartDate=l),e=m.modifyRequestHeader(e),e.onload=w,e.onloadend=u,e.onerror=u,e.onprogress=v;var z=(new Date).getTime();isNaN(d.delayLoadingTime)||z>=d.delayLoadingTime?(o.push(e),e.send()):!function(){var a={xhr:e};p.push(a),a.delayTimeout=setTimeout(function(){if(-1!==p.indexOf(a)){p.splice(p.indexOf(a),1);try{o.push(a.xhr),a.xhr.send()}catch(b){a.xhr.onerror()}}},d.delayLoadingTime-z)}()}catch(A){e.onerror()}}function d(a){a.request&&c(a,i.getRetryAttemptsForType(a.request.type))}function f(){q.forEach(function(a){return clearTimeout(a)}),q=[],p.forEach(function(a){return clearTimeout(a.delayTimeout)}),p=[],o.forEach(function(a){a.onloadend=a.onerror=void 0,a.abort()}),o=[]}var g=this.context,i=(0,l["default"])(g).getInstance(),j=a.errHandler,k=a.metricsModel,m=a.requestModifier,n=void 0,o=void 0,p=void 0,q=void 0,r=void 0;return n={load:d,abort:f},b(),n}Object.defineProperty(c,"__esModule",{value:!0});var g=a("./vo/metrics/HTTPRequest.js"),h=d(g),i=a("../core/FactoryMaker.js"),j=d(i),k=a("./models/MediaPlayerModel.js"),l=d(k);f.__dashjs_factory_name="XHRLoader";var m=j["default"].getClassFactory(f);c["default"]=m,b.exports=c["default"]},{"../core/FactoryMaker.js":9,"./models/MediaPlayerModel.js":90,"./vo/metrics/HTTPRequest.js":166}],48:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a){function b(a,b,c){var e=function(d,e){b.resolved=!0,b.resolvedContent=d?d:null,f.trigger(q["default"].XLINK_ELEMENT_LOADED,{element:b,resolveObject:c,error:d||e?null:new g["default"](t,"Failed loading Xlink element: "+a)})};if(a===d)e(null,!0);else{var i=new m["default"](a,k["default"].XLINK_TYPE);h.load({request:i,success:function(a){e(a)},error:function(){e(null)}})}}function c(){h&&(h.abort(),h=null)}var d="urn:mpeg:dash:resolve-to-zero:2013",e=this.context,f=(0,o["default"])(e).getInstance(),h=(0,i["default"])(e).create({errHandler:a.errHandler,metricsModel:a.metricsModel,requestModifier:a.requestModifier}),j=void 0;return j={load:b,reset:c}}Object.defineProperty(c,"__esModule",{value:!0});var f=a("./vo/Error.js"),g=d(f),h=a("./XHRLoader.js"),i=d(h),j=a("./vo/metrics/HTTPRequest.js"),k=d(j),l=a("./vo/TextRequest.js"),m=d(l),n=a("../core/EventBus.js"),o=d(n),p=a("../core/events/Events.js"),q=d(p),r=a("../core/FactoryMaker.js"),s=d(r),t=1;e.__dashjs_factory_name="XlinkLoader";var u=s["default"].getClassFactory(e);u.XLINK_LOADER_ERROR_LOADING_FAILURE=t,c["default"]=u,b.exports=c["default"]},{"../core/EventBus.js":8,"../core/FactoryMaker.js":9,"../core/events/Events.js":11,"./XHRLoader.js":47,"./vo/Error.js":149,"./vo/TextRequest.js":157,"./vo/metrics/HTTPRequest.js":166}],49:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(){function a(){da={video:!0,audio:!0},ea={},fa={},ga={},ha={},ia={},ja={},la={},ka={},na=!1,sa=(0,k["default"])(Z).getInstance(),ra=(0,o["default"])(Z).getInstance(),oa=(0,y["default"])(Z).getInstance(),pa=(0,A["default"])(Z).getInstance(),qa=(0,C["default"])(Z).getInstance()}function b(a,b){ka[a]=b,la[a]=la[a]||{},la[a].state=E,$.on(u["default"].LOADING_PROGRESS,Y,this)}function c(a){a&&(a.abrRulesCollection&&(aa=a.abrRulesCollection),a.rulesController&&(ba=a.rulesController),a.streamController&&(ca=a.streamController))}function d(a,b){var c;return ea[b]=ea[b]||{},ea[b].hasOwnProperty(a)||(ea[b][a]=0),c=V(ea[b][a],a),c=W(c,a,ea[b][a]),c=X(c,a)}function e(a){var b=sa.getSavedBitrateSettings(a);if(!ha.hasOwnProperty(a))if(ia.hasOwnProperty(a)){var c=oa.getValue(),d=pa.getAdaptationForType(c,0,a).Representation;if(Array.isArray(d)){var e=Math.max(Math.round(d.length*ia[a])-1,0);ha[a]=d[e].bandwidth}else ha[a]=0}else isNaN(b)?ha[a]="video"===a?F:G:ha[a]=b;return ha[a]}function f(a,b){ha[a]=b}function h(a){return ia.hasOwnProperty(a)?ia[a]:null}function j(a,b){ia[a]=b}function l(a){return ha.hasOwnProperty("max")&&ha.max.hasOwnProperty(a)?ha.max[a]:NaN}function n(a,b){ha.max=ha.max||{},ha.max[a]=b}function p(a){return ia.hasOwnProperty("max")&&ia.max.hasOwnProperty(a)?ia.max[a]:1}function r(a,b){ia.max=ia.max||{},ia.max[a]=b}function t(a){return da[a]}function v(a,b){da[a]=b}function w(){return na}function x(a){na=a}function z(a,b){var c,e,f,h,i=a.getType(),j=a.getStreamInfo(),k=j.id,l=function(f){var g=d(i,k);c=f.value,h=f.confidence,0>c&&(c=0),c>g&&(c=g),e=Q(i,j),c!==e&&(la[i].state===E||c>e)&&(R(i,k,c),T(i,k,h),$.trigger(u["default"].QUALITY_CHANGED,{mediaType:i,streamInfo:a.getStreamInfo(),oldQuality:e,newQuality:c})),b&&b()};c=Q(i,j),h=S(i,k),t(i)?(f=aa.getRules(m["default"].QUALITY_SWITCH_RULES),ba.applyRules(f,a,l,c,function(a,b){return a=a===g["default"].NO_CHANGE?0:a,Math.max(a,b)})):b&&b()}function B(a,b,c){var e=b.id,f=Q(a,b),g=null!==c&&!isNaN(c)&&c%1===0;if(!g)throw"argument is not an integer";c!==f&&c>=0&&c<=d(a,e)&&(R(a,e,c),$.trigger(u["default"].QUALITY_CHANGED,{mediaType:a,streamInfo:b,oldQuality:f,newQuality:c}))}function H(a,b){la[a].state=b}function I(a){return la[a].state}function J(a,b){var c=K(a),d=void 0;if(!c||0===c.length)return-1;for(var e=c.length-1;e>=0;e--)if(d=c[e],1e3*b>=d.bitrate)return e;return 0}function K(a){if(!a||!a.bitrateList)return null;for(var b,c=a.bitrateList,d=a.type,e=[],f=0,g=c.length;g>f;f++)b=new i["default"],b.mediaType=d,b.qualityIndex=f,b.bitrate=c[f].bandwidth,b.width=c[f].width,b.height=c[f].height,e.push(b);return e}function L(a,b){ja[a]=b}function M(a){return ja[a]}function N(a){var b=a.type,c=a.streamInfo.id,d=a.representationCount-1;return U(b,c,d),d}function O(a){var b,c=a.id,e=Q("audio",a),f=Q("video",a);return b=e===d("audio",c)&&f===d("video",c)}function P(){$.off(u["default"].LOADING_PROGRESS,Y,this),clearTimeout(ma),ma=null,a()}function Q(a,b){var c,d=b.id;return fa[d]=fa[d]||{},fa[d].hasOwnProperty(a)||(fa[d][a]=0),c=fa[d][a]}function R(a,b,c){fa[b]=fa[b]||{},fa[b][a]=c}function S(a,b){var c;return ga[b]=ga[b]||{},ga[b].hasOwnProperty(a)||(ga[b][a]=0),c=ga[b][a]}function T(a,b,c){ga[b]=ga[b]||{},ga[b][a]=c}function U(a,b,c){ea[b]=ea[b]||{},ea[b][a]=c}function V(a,b){var c=l(b);if(isNaN(c)||!ka[b])return a;var d=J(ka[b].getMediaInfo(),c);return Math.min(a,d)}function W(a,b,c){var d=p(b);return isNaN(d)||d>=1||0>d?a:Math.min(a,Math.round(c*d))}function X(a,b){if("video"!==b||!na||!ka[b])return a;var c=qa.getElement(),d=c.clientWidth,e=c.clientHeight,f=oa.getValue(),g=pa.getAdaptationForType(f,0,b).Representation,h=a;if(d>0&&e>0){for(;h>0&&g[h]&&d=h&&g[h].width===g[h+1].width&&(h=Math.min(a,h+1))}return h}function Y(a){var b=a.request.mediaType;if(t(b)){var c=aa.getRules(m["default"].ABANDON_FRAGMENT_RULES),d=ka[b].getScheduleController();if(!d)return;var e=d.getFragmentModel(),f=function(a){function c(a){ma=setTimeout(function(){H(a,E)},ra.getAbandonLoadTimeout())}if(a.confidence===g["default"].STRONG){var f=e.getRequests({state:q["default"].FRAGMENT_MODEL_LOADING}),h=a.value,i=Q(b,ca.getActiveStreamInfo());i>h&&(e.abortRequests(),H(b,D),B(b,ca.getActiveStreamInfo(),h),d.replaceCanceledRequests(f),c(b))}};ba.applyRules(c,ka[b],f,a,function(a,b){return b})}}var Z=this.context,$=(0,s["default"])(Z).getInstance(),_=void 0,aa=void 0,ba=void 0,ca=void 0,da=void 0,ea=void 0,fa=void 0,ga=void 0,ha=void 0,ia=void 0,ja=void 0,ka=void 0,la=void 0,ma=void 0,na=void 0,oa=void 0,pa=void 0,qa=void 0,ra=void 0,sa=void 0;return _={isPlayingAtTopQuality:O,updateTopQualityIndex:N,getAverageThroughput:M,getBitrateList:K,getQualityForBitrate:J,getMaxAllowedBitrateFor:l,setMaxAllowedBitrateFor:n,getMaxAllowedRepresentationRatioFor:p,setMaxAllowedRepresentationRatioFor:r,getInitialBitrateFor:e,setInitialBitrateFor:f,getInitialRepresentationRatioFor:h,setInitialRepresentationRatioFor:j,setAutoSwitchBitrateFor:v,getAutoSwitchBitrateFor:t,setLimitBitrateByPortal:x,getLimitBitrateByPortal:w,getConfidenceFor:S,getQualityFor:Q,getAbandonmentStateFor:I,setAbandonmentStateFor:H,setPlaybackQuality:B,getPlaybackQuality:z,setAverageThroughput:L,getTopQualityIndexFor:d,initialize:b,setConfig:c,reset:P},a(),_}Object.defineProperty(c,"__esModule",{value:!0});var f=a("../rules/SwitchRequest"),g=d(f),h=a("../vo/BitrateInfo.js"),i=d(h),j=a("../utils/DOMStorage.js"),k=d(j),l=a("../rules/abr/ABRRulesCollection.js"),m=d(l),n=a("../models/MediaPlayerModel.js"),o=d(n),p=a("../models/FragmentModel.js"),q=d(p),r=a("../../core/EventBus.js"),s=d(r),t=a("../../core/events/Events.js"),u=d(t),v=a("../../core/FactoryMaker.js"),w=d(v),x=a("../models/ManifestModel.js"),y=d(x),z=a("../../dash/models/DashManifestModel.js"),A=d(z),B=a("../models/VideoModel.js"),C=d(B),D="abandonload",E="allowload",F=1e3,G=100;e.__dashjs_factory_name="AbrController";var H=w["default"].getSingletonFactory(e);H.ABANDON_LOAD=D,c["default"]=H,b.exports=c["default"]},{"../../core/EventBus.js":8,"../../core/FactoryMaker.js":9,"../../core/events/Events.js":11,"../../dash/models/DashManifestModel.js":19,"../models/FragmentModel.js":88,"../models/ManifestModel.js":89,"../models/MediaPlayerModel.js":90,"../models/VideoModel.js":93,"../rules/SwitchRequest":119,"../rules/abr/ABRRulesCollection.js":120,"../utils/DOMStorage.js":138,"../vo/BitrateInfo.js":147}],50:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(){function a(a){o.invalidateSelectedIndexes(a.entry)}function b(){o=(0,g["default"])(j).create(),p=(0,i["default"])(j).create(),l.on(s["default"].SERVICE_LOCATION_BLACKLIST_CHANGED,a,h)}function c(a){o.update(a),p.chooseSelectorFromManifest(a)}function d(a){var b=o.getForPath(a),c=b.reduce(function(a,b){var c=p.select(b);return c&&(n.isRelative(c.url)?a.url+=c.url:(a.url=c.url,a.serviceLocation=c.serviceLocation)),a},new m["default"]);return n.isRelative(c.url)?void 0:c}function e(){o.reset(),p.reset()}function f(a){c(a)}var h=void 0,j=this.context,l=(0,q["default"])(j).getInstance(),n=(0,k["default"])(j).getInstance(),o=void 0,p=void 0;return h={reset:e,initialize:f,resolve:d},b(),h}Object.defineProperty(c,"__esModule",{value:!0});var f=a("../models/BaseURLTreeModel.js"),g=d(f),h=a("../utils/BaseURLSelector.js"),i=d(h),j=a("../utils/URLUtils.js"),k=d(j),l=a("../../dash/vo/BaseURL.js"),m=d(l),n=a("../../core/FactoryMaker.js"),o=d(n),p=a("../../core/EventBus.js"),q=d(p),r=a("../../core/events/Events.js"),s=d(r);e.__dashjs_factory_name="BaseURLController",c["default"]=o["default"].getSingletonFactory(e),b.exports=c["default"]},{"../../core/EventBus.js":8,"../../core/FactoryMaker.js":9,"../../core/events/Events.js":11,"../../dash/vo/BaseURL.js":28,"../models/BaseURLTreeModel.js":87,"../utils/BaseURLSelector.js":134,"../utils/URLUtils.js":145}],51:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a){function b(a){return g.length&&a&&a.length?-1!==g.indexOf(a):!1}function c(a){-1===g.indexOf(a)&&(g.push(a),h.trigger(j,{entry:a}))}function d(a){a.error&&c(a.request.serviceLocation)}function e(){k&&h.on(k,d,this)}function f(){g=[]}var g=[],h=(0,i["default"])(this.context).getInstance(),j=a.updateEventName,k=a.loadFailedEventName;return e(),{add:c,contains:b,reset:f}}Object.defineProperty(c,"__esModule",{value:!0});var f=a("../../core/FactoryMaker.js"),g=d(f),h=a("../../core/EventBus.js"),i=d(h);e.__dashjs_factory_name="BlackListController",c["default"]=g["default"].getClassFactory(e),b.exports=c["default"]},{"../../core/EventBus.js":8,"../../core/FactoryMaker.js":9}],52:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a){function b(){wa=-1,xa=-1,ya=!1,za=0,Aa=0,Ba=Number.POSITIVE_INFINITY,Da=-1,Ea=-1,Ga=null,Ha=G,Ja=0,Ka=!1,La=!1,Ma=!1,Na=!1,Ua=null}function c(a,b,c){Fa=a,da(b),Pa=c,Ta=(0,i["default"])(ia).getInstance(),Oa=(0,q["default"])(ia).getInstance(),Qa=(0,o["default"])(ia).getInstance(),Ra=Pa.getFragmentController(),Sa=Pa.getScheduleController(),wa=Qa.getQualityFor(Fa,Pa.getStreamInfo()),ka.on(y["default"].DATA_UPDATE_COMPLETED,S,this),ka.on(y["default"].INIT_FRAGMENT_LOADED,f,this),ka.on(y["default"].MEDIA_FRAGMENT_LOADED,h,this),ka.on(y["default"].QUALITY_CHANGED,r,this),ka.on(y["default"].STREAM_COMPLETED,T,this),ka.on(y["default"].PLAYBACK_PROGRESS,v,this),ka.on(y["default"].PLAYBACK_TIME_UPDATED,v,this),ka.on(y["default"].PLAYBACK_RATE_CHANGED,X,this),ka.on(y["default"].PLAYBACK_SEEKING,t,this),ka.on(y["default"].WALLCLOCK_TIME_UPDATED,W,this),ka.on(y["default"].CURRENT_TRACK_CHANGED,V,this),ka.on(y["default"].SOURCEBUFFER_APPEND_COMPLETED,p,this),ka.on(y["default"].SOURCEBUFFER_REMOVE_COMPLETED,O,this),ka.on(y["default"].CHUNK_APPENDED,U,this)}function d(a){if(!a||!Ca||!Pa)return null;var b=null;try{b=na.createSourceBuffer(Ca,a),b&&b.hasOwnProperty("initialize")&&b.initialize(Fa,this)}catch(c){oa.mediaSourceError("Error creating "+Fa+" source buffer.")}return aa(b),P(Pa.getRepresentationInfoForQuality(wa).MSETimeOffset),j(),b}function e(){var a=Pa.getStreamInfo().id,b=qa.getActiveStreamInfo().id;return a===b}function f(a){var b;a.fragmentModel===Pa.getFragmentModel()&&(ja("Initialization finished loading"),b=a.chunk,ta.append(b),l(Q(),wa))}function h(a){if(a.fragmentModel===Pa.getFragmentModel()){var b,c=a.chunk,d=c.bytes,e=c.quality,f=c.index,h=Pa.getFragmentModel().getRequests({state:g["default"].FRAGMENT_MODEL_EXECUTED,quality:e,index:f})[0],i=Pa.getRepresentationInfoForQuality(e),k=ma.getValue(),l=sa.getEventsFor(k,i.mediaInfo,Pa),m=sa.getEventsFor(k,i,Pa);(l.length>0||m.length>0)&&(b=I(d,h,l,m),Pa.getEventController().addInbandEvents(b)),c.bytes=J(d),ta.append(c),j()}}function j(){if(Ga&&!La&&K()){var a,b=Q();if(Ka)a=Ka;else{if(a=ta.extract({streamId:b,mediaType:Fa,segmentType:k["default"].MEDIA_SEGMENT_TYPE,limit:1})[0],!a)return;Ka=a}a.quality===xa?(Ka=!1,n(a)):l(b,Ka.quality)}}function l(a,b){var c={streamId:a,mediaType:Fa,segmentType:k["default"].INIT_SEGMENT_TYPE,quality:b},d=ta.getChunks(c)[0];if(d){if(!Ga)return;n(d)}else ka.trigger(y["default"].INIT_REQUESTED,{sender:va,requiredQuality:b})}function n(a){La=!0,Ia=a,na.append(Ga,a),"video"===a.mediaInfo.type&&a.mediaInfo.embeddedCaptions&&ua.append(a.bytes,a)}function p(a){if(Ga===a.buffer){v(),ya&&Pa.getStreamInfo().isLast&&pa.signalEndOfStream(Ca);var b;if(a.error)return a.error.code===m["default"].QUOTA_EXCEEDED_ERROR_CODE&&(ta.append(Ia),Ba=.8*na.getTotalBufferedTime(Ga),ka.trigger(y["default"].QUOTA_EXCEEDED,{sender:va,criticalBufferLevel:Ba}),N(M())),void(La=!1);if(K()||(ka.trigger(y["default"].QUOTA_EXCEEDED,{sender:va,criticalBufferLevel:Ba}),N(M())),b=na.getAllRanges(Ga),b&&b.length>0){var c,d;for(c=0,d=b.length;d>c;c++)ja("Buffered Range: "+b.start(c)+" - "+b.end(c))}La=!1,isNaN(Ia.index)?(xa=Ia.quality,Pa.isDynamic()||j()):(ta.storeAppendedChunk(Ia,Ga),R(),Da=Math.max(Ia.index,Da),B()),ka.trigger(y["default"].BYTES_APPENDED,{sender:va,quality:Ia.quality,startTime:Ia.start,index:Ia.index,bufferedRanges:b})}}function r(a){var b=a.newQuality;wa!==b&&Fa===a.mediaType&&Pa.getStreamInfo().id===a.streamInfo.id&&(P(Pa.getRepresentationInfoForQuality(b).MSETimeOffset),wa=b)}function t(){La=!1,v()}function v(){x(),z()}function x(){var a=Oa.getTime();za=na.getBufferLength(Ga,a),ka.trigger(y["default"].BUFFER_LEVEL_UPDATED,{sender:va,bufferLevel:za}),C()}function z(){e()&&(la.addBufferState(Fa,Ha,Aa),la.addBufferLevel(Fa,new Date,1e3*za))}function B(){var a=Da===Ea-1;a&&!ya&&(ya=!0,ka.trigger(y["default"].BUFFERING_COMPLETED,{sender:va,streamInfo:Pa.getStreamInfo()}))}function C(){D(H>za&&!ya?G:F)}function D(a){if(!(Ha===a||"fragmentedText"===Fa&&ua.getAllTracksAreDisabled())){Ha=a,z(),ka.trigger(y["default"].BUFFER_LEVEL_STATE_CHANGED,{sender:va,state:a,mediaType:Fa,streamInfo:Pa.getStreamInfo()});var b=a===F?y["default"].BUFFER_LOADED:y["default"].BUFFER_EMPTY;ka.trigger(b,{mediaType:Fa}),ja(a===F?"Got enough buffer to start.":"Waiting for more buffer before starting playback.")}}function I(a,b,c,d){var e,f,g,h,i=Math.max(isNaN(b.startTime)?0:b.startTime,0),j=[],k=[];Na=!1,h=c.concat(d);for(var l=0;lm;m++)f=sa.getEvent(e[m],j,i),f&&k.push(f);return k}function J(a){if(!Na)return a;for(var b,c,d=a.length,e=Math.pow(256,2),f=Math.pow(256,3),g=new Uint8Array(a.length),h=0,i=0;d>h;){if(b=String.fromCharCode(a[h+4],a[h+5],a[h+6],a[h+7]),c=a[h]*f+a[h+1]*e+256*a[h+2]+1*a[h+3],"emsg"!=b)for(var j=h;h+c>j;j++)g[i]=a[j],i++; +h+=c}return g.subarray(0,i)}function K(){var a=na.getTotalBufferedTime(Ga);return Ba>a}function L(){if("fragmentedText"!==Fa){ja("try to prune buffer");var a=Ga.buffered.length?Ga.buffered.start(0):0,b=Oa.getTime(),c=b-a-Ta.getBufferToKeep();c>0&&(ja("pruning buffer: "+c+" seconds."),Ma=!0,na.remove(Ga,0,Math.round(a+c),Ca))}}function M(){var a,b,c,d,e;return Ga?(a=Oa.getTime(),e=Pa.getFragmentModel().getRequests({state:g["default"].FRAGMENT_MODEL_EXECUTED,time:a})[0],c=e&&!isNaN(e.startTime)?e.startTime:Math.floor(a),d=na.getBufferRange(Ga,a),null===d&&Ga.buffered.length>0&&(c=Ga.buffered.end(Ga.buffered.length-1)),b=Ga.buffered.start(0),{start:b,end:c}):null}function N(a){if(a&&Ga){var b=a.start,c=a.end;na.remove(Ga,b,c,Ca)}}function O(a){Ga===a.buffer&&(Ma&&(Ma=!1),ta.updateBufferedRanges({streamId:Q(),mediaType:Fa},na.getAllRanges(Ga)),x(),ka.trigger(y["default"].BUFFER_CLEARED,{sender:va,from:a.from,to:a.to,hasEnoughSpaceToAppend:K()}),K()||null===Ua&&(Ua=setTimeout(function(){Ua=null,N(M())},1e3*Pa.getStreamInfo().manifestInfo.minBufferTime)))}function P(a){Ga&&Ga.timestampOffset!==a&&!isNaN(a)&&(Ga.timestampOffset=a)}function Q(){return Pa.getStreamInfo().id}function R(){var a,b,c,d=ta.getChunks({streamId:Q(),mediaType:Fa,segmentType:k["default"].MEDIA_SEGMENT_TYPE,appended:!0}),e=(0,u["default"])(ia),f=e.create(),g=e.create(),h=Oa.getTime(),i=2*Pa.getCurrentRepresentationInfo().fragmentDuration;if(d.forEach(function(a){b=ra.isCurrentTrack(a.mediaInfo)?g:f,b.add(a.bufferedRange.start,a.bufferedRange.end)}),0!==f.length&&0!==g.length&&(a=na.getBufferLength({buffered:g},h),!(i>a)))for(var j=0,l=f.length;l>j;j++)c={start:f.start(j),end:f.end(j)},(ra.getSwitchMode(Fa)===s["default"].TRACK_SWITCH_MODE_ALWAYS_REPLACE||c.start>h)&&N(c)}function S(a){a.sender.getStreamProcessor()===Pa&&(a.error||P(a.currentRepresentation.MSETimeOffset))}function T(a){a.fragmentModel===Pa.getFragmentModel()&&(Ea=a.request.index,B())}function U(a){a.sender===ta&&z()}function V(a){if(Ga&&a.newMediaInfo.type===Fa&&a.newMediaInfo.streamInfo.id===Pa.getStreamInfo().id){var b=a.newMediaInfo,c=b.type,d=a.switchMode,e=Oa.getTime(),f={start:0,end:e};if(Fa===c)switch(d){case s["default"].TRACK_SWITCH_MODE_ALWAYS_REPLACE:N(f);break;case s["default"].TRACK_SWITCH_MODE_NEVER_REPLACE:break;default:ja("track switch mode is not supported: "+d)}}}function W(){var a;Ja++,a=Ja*(Ta.getWallclockTimeUpdateInterval()/1e3),a>=Ta.getBufferPruningInterval()&&!La&&(Ja=0,L())}function X(){C()}function Y(){return Fa}function Z(){return Pa}function $(a){Pa=a}function _(){return Ga}function aa(a){Ga=a}function ba(){return za}function ca(){return Ba}function da(a){Ca=a}function ea(){return Ca}function fa(){return ya}function ga(){return La}function ha(a){ka.off(y["default"].DATA_UPDATE_COMPLETED,S,this),ka.off(y["default"].QUALITY_CHANGED,r,this),ka.off(y["default"].INIT_FRAGMENT_LOADED,f,this),ka.off(y["default"].MEDIA_FRAGMENT_LOADED,h,this),ka.off(y["default"].STREAM_COMPLETED,T,this),ka.off(y["default"].CURRENT_TRACK_CHANGED,V,this),ka.off(y["default"].PLAYBACK_PROGRESS,v,this),ka.off(y["default"].PLAYBACK_TIME_UPDATED,v,this),ka.off(y["default"].PLAYBACK_RATE_CHANGED,X,this),ka.off(y["default"].PLAYBACK_SEEKING,t,this),ka.off(y["default"].WALLCLOCK_TIME_UPDATED,W,this),ka.off(y["default"].SOURCEBUFFER_APPEND_COMPLETED,p,this),ka.off(y["default"].SOURCEBUFFER_REMOVE_COMPLETED,O,this),ka.off(y["default"].CHUNK_APPENDED,U,this),clearTimeout(Ua),Ua=null,Ba=Number.POSITIVE_INFINITY,Ha=G,xa=-1,Ea=-1,Da=-1,wa=0,Ia=null,Ka=!1,ya=!1,La=!1,Ma=!1,Oa=null,Pa=null,Qa=null,Ra=null,Sa=null,a||(na.abort(Ca,Ga),na.removeSourceBuffer(Ca,Ga)),Ga=null}var ia=this.context,ja=(0,E["default"])(ia).getInstance().log,ka=(0,w["default"])(ia).getInstance(),la=a.metricsModel,ma=a.manifestModel,na=a.sourceBufferController,oa=a.errHandler,pa=a.mediaSourceController,qa=a.streamController,ra=a.mediaController,sa=a.adapter,ta=a.virtualBuffer,ua=a.textSourceBuffer,va=void 0,wa=void 0,xa=void 0,ya=void 0,za=void 0,Aa=void 0,Ba=void 0,Ca=void 0,Da=void 0,Ea=void 0,Fa=void 0,Ga=void 0,Ha=void 0,Ia=void 0,Ja=void 0,Ka=void 0,La=void 0,Ma=void 0,Na=void 0,Oa=void 0,Pa=void 0,Qa=void 0,Ra=void 0,Sa=void 0,Ta=void 0,Ua=void 0;return va={initialize:c,createBuffer:d,getType:Y,getStreamProcessor:Z,setStreamProcessor:$,getBuffer:_,setBuffer:aa,getBufferLevel:ba,getCriticalBufferLevel:ca,setMediaSource:da,getMediaSource:ea,getIsBufferingCompleted:fa,getIsAppendingInProgress:ga,reset:ha},b(),va}Object.defineProperty(c,"__esModule",{value:!0});var f=a("../models/FragmentModel.js"),g=d(f),h=a("../models/MediaPlayerModel.js"),i=d(h),j=a("../vo/metrics/HTTPRequest.js"),k=d(j),l=a("./SourceBufferController.js"),m=d(l),n=a("./AbrController.js"),o=d(n),p=a("./PlaybackController.js"),q=d(p),r=a("./MediaController.js"),s=d(r),t=a("../utils/CustomTimeRanges.js"),u=d(t),v=a("../../core/EventBus.js"),w=d(v),x=a("../../core/events/Events.js"),y=d(x),z=a("../utils/BoxParser.js"),A=d(z),B=a("../../core/FactoryMaker.js"),C=d(B),D=a("../../core/Debug.js"),E=d(D),F="bufferLoaded",G="bufferStalled",H=.5;e.__dashjs_factory_name="BufferController";var I=C["default"].getClassFactory(e);I.BUFFER_LOADED=F,I.BUFFER_EMPTY=G,c["default"]=I,b.exports=c["default"]},{"../../core/Debug.js":7,"../../core/EventBus.js":8,"../../core/FactoryMaker.js":9,"../../core/events/Events.js":11,"../models/FragmentModel.js":88,"../models/MediaPlayerModel.js":90,"../utils/BoxParser.js":135,"../utils/CustomTimeRanges.js":137,"../vo/metrics/HTTPRequest.js":166,"./AbrController.js":49,"./MediaController.js":55,"./PlaybackController.js":57,"./SourceBufferController.js":59}],53:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(){function a(){D=!1,u={},v={},w={},x=null,y=100,z=y/1e3,C=(0,g["default"])(q).getInstance()}function b(){null!==x&&D&&(clearInterval(x),x=null,D=!1)}function c(){r("Start Event Controller"),D||isNaN(y)||(D=!0,x=setInterval(h,y))}function d(a){if(u={},a)for(var b=0;b=b&&b+z>c)&&(r("Start Event "+f+" at "+c),g.duration>0&&(w[f]=g),g.eventStream.schemeIdUri==o&&g.eventStream.value==p?i():s.trigger(g.eventStream.schemeIdUri,{event:g}),delete a[f]))}}function l(a){a&&(a.manifestModel&&(A=a.manifestModel),a.manifestUpdater&&(B=a.manifestUpdater))}function n(){b(),u=null,v=null,w=null,C=null}var o="urn:mpeg:dash:event:2012",p=1,q=this.context,r=(0,k["default"])(q).getInstance().log,s=(0,m["default"])(q).getInstance(),t=void 0,u=void 0,v=void 0,w=void 0,x=void 0,y=void 0,z=void 0,A=void 0,B=void 0,C=void 0,D=void 0;return t={initialize:a,addInlineEvents:d,addInbandEvents:e,clear:b,start:c,setConfig:l,reset:n}}Object.defineProperty(c,"__esModule",{value:!0});var f=a("../controllers/PlaybackController.js"),g=d(f),h=a("../../core/FactoryMaker.js"),i=d(h),j=a("../../core/Debug.js"),k=d(j),l=a("../../core/EventBus.js"),m=d(l);e.__dashjs_factory_name="EventController",c["default"]=i["default"].getSingletonFactory(e),b.exports=c["default"]},{"../../core/Debug.js":7,"../../core/EventBus.js":8,"../../core/FactoryMaker.js":9,"../controllers/PlaybackController.js":57}],54:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(){function a(){t=[],r.on(q["default"].FRAGMENT_LOADING_COMPLETED,l,s)}function b(a){var b=null;return null!==a&&void 0!==a&&a.byteLength>0&&(b=new Uint8Array(a)),b}function c(a){if(!a)return null;var b=h(a);return b||(b=(0,k["default"])(n).create({metricsModel:(0,m["default"])(n).getInstance()}),b.setScheduleController(a),t.push(b)),b}function d(a){var b=t.indexOf(a);b>-1&&t.splice(b,1)}function e(a){return a&&a.type&&a.type===g["default"].INIT_SEGMENT_TYPE}function f(){r.off(q["default"].FRAGMENT_LOADING_COMPLETED,l,this),t=[]}function h(a){for(var b=t.length,c=0;b>c;c++)if(t[c].getScheduleController()==a)return t[c];return null}function j(a,b,c){var d=new i["default"];return d.streamId=c,d.mediaInfo=b.mediaInfo,d.segmentType=b.type,d.start=b.startTime,d.duration=b.duration,d.end=d.start+d.duration,d.bytes=a,d.index=b.index,d.quality=b.quality,d}function l(a){var b=a.sender.getScheduleController();if(h(b)){var c=a.request,d=a.response,f=e(c),g=b.getStreamProcessor().getStreamInfo().id,i=void 0;if(!d)return void p("No "+c.mediaType+" bytes to push.");i=j(d,c,g),r.trigger(f?q["default"].INIT_FRAGMENT_LOADED:q["default"].MEDIA_FRAGMENT_LOADED,{chunk:i,fragmentModel:a.sender})}}var n=this.context,p=(0,u["default"])(n).getInstance().log,r=(0,o["default"])(n).getInstance(),s=void 0,t=void 0;return s={process:b,getModel:c,detachModel:d,isInitializationRequest:e,reset:f},a(),s}Object.defineProperty(c,"__esModule",{value:!0});var f=a("../vo/metrics/HTTPRequest.js"),g=d(f),h=a("../vo/DataChunk.js"),i=d(h),j=a("../models/FragmentModel.js"),k=d(j),l=a("../models/MetricsModel.js"),m=d(l),n=a("../../core/EventBus.js"),o=d(n),p=a("../../core/events/Events.js"),q=d(p),r=a("../../core/FactoryMaker.js"),s=d(r),t=a("../../core/Debug.js"),u=d(t);e.__dashjs_factory_name="FragmentController",c["default"]=s["default"].getClassFactory(e),b.exports=c["default"]},{"../../core/Debug.js":7,"../../core/EventBus.js":8,"../../core/FactoryMaker.js":9,"../../core/events/Events.js":11,"../models/FragmentModel.js":88,"../models/MetricsModel.js":91,"../vo/DataChunk.js":148,"../vo/metrics/HTTPRequest.js":166}],55:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(){function a(){N={},E(),D()}function b(a,b){var c=k(a),e=d(a,b),f=[];return"fragmentedText"===a?void h(e[0]):(c||(c=L.getSavedMediaSettings(a),j(a,c)),void(e&&0!==e.length&&(c&&e.forEach(function(a){C(c,a)&&f.push(a)}),h(0===f.length?F(e):f.length>1?F(f):f[0]))))}function c(a){var b=a?a.type:null,c=a?a.streamInfo.id:null,d=k(b);return a&&x(b)?(N[c]=N[c]||G(),N[c][b].list.indexOf(a)>=0?!1:(N[c][b].list.push(a),d&&C(d,a)&&!e(b,a.streamInfo)&&h(a),!0)):!1}function d(a,b){if(!a||!b)return[];var c=b.id;return N[c]&&N[c][a]?N[c][a].list:[]}function e(a,b){return a&&b?N[b.id][a].current:null}function f(a){var b=a.type,c=a.streamInfo.id;return N[c]&&N[c][b]&&y(N[c][b].current,a)}function h(a){if(a){var b=a.type,c=a.streamInfo,d=c.id,f=e(b,c);if(N[d]&&N[d][b]&&(!f||!y(a,f))){N[d][b].current=a,f&&J.trigger(g["default"].CURRENT_TRACK_CHANGED,{oldMediaInfo:f,newMediaInfo:a,switchMode:Q[b]});var h=B(a);h&&N[d][b].storeLastSettings&&(h.roles&&(h.role=h.roles[0],delete h.roles),h.accessibility&&(h.accessibility=h.accessibility[0]),h.audioChannelConfiguration&&(h.audioChannelConfiguration=h.audioChannelConfiguration[0]),L.setSavedMediaSettings(b,h))}}}function j(a,b){a&&b&&(O[a]=b)}function k(a){return a?O[a]:null}function l(a,b){var c=-1!==S.indexOf(b);return c?void(Q[a]=b):void I("track switch mode is not supported: "+b)}function n(a){return Q[a]}function p(a){var b=-1!==T.indexOf(a);return b?void(P=a):void I("track selection mode is not supported: "+a)}function w(){return P||v}function x(a){return"audio"===a||"video"===a||"text"===a||"fragmentedText"===a}function y(a,b){var c=a.id===b.id,d=a.viewpoint===b.viewpoint,e=a.lang===b.lang,f=a.roles.toString()==b.roles.toString(),g=a.accessibility.toString()==b.accessibility.toString(),h=a.audioChannelConfiguration.toString()==b.audioChannelConfiguration.toString();return c&&d&&e&&f&&g&&h}function z(a){a&&a.errHandler&&(R=a.errHandler)}function A(){a(),K.resetEmbedded()}function B(a){var b={lang:a.lang,viewpoint:a.viewpoint,roles:a.roles,accessibility:a.accessibility,audioChannelConfiguration:a.audioChannelConfiguration},c=b.lang||b.viewpoint||b.role&&b.role.length>0||b.accessibility&&b.accessibility.length>0||b.audioChannelConfiguration&&b.audioChannelConfiguration.length>0;return c?b:null}function C(a,b){var c=!a.lang||a.lang===b.lang,d=!a.viewpoint||a.viewpoint===b.viewpoint,e=!a.role||!!b.roles.filter(function(b){return b===a.role})[0],f=!a.accessibility||!!b.accessibility.filter(function(b){return b===a.accessibility})[0],g=!a.audioChannelConfiguration||!!b.audioChannelConfiguration.filter(function(b){return b===a.audioChannelConfiguration})[0];return c&&d&&e&&f&&g}function D(){Q={audio:s,video:r}}function E(){O={audio:null,video:null}}function F(a){var b=w(),c=[],d=function(a){var b,c=0,d=[];return a.forEach(function(a){b=Math.max.apply(Math,a.bitrateList.map(function(a){return a.bandwidth})),b>c?(c=b,d=[a]):b===c&&d.push(a)}),d},e=function(a){var b,c=0,d=[];return a.forEach(function(a){b=a.representationCount,b>c?(c=b,d=[a]):b===c&&d.push(a)}),d};switch(b){case t:c=d(a),c.length>1&&(c=e(c));break;case u:c=e(a),c.length>1&&(c=d(a));break;default:I("track selection mode is not supported: "+b)}return c[0]}function G(){return{audio:{list:[],storeLastSettings:!0,current:null},video:{list:[],storeLastSettings:!0,current:null},text:{list:[],storeLastSettings:!0,current:null},fragmentedText:{list:[],storeLastSettings:!0,current:null}}}var H=this.context,I=(0,m["default"])(H).getInstance().log,J=(0,i["default"])(H).getInstance(),K=(0,o["default"])(H).getInstance(),L=(0,q["default"])(H).getInstance(),M=void 0,N=void 0,O=void 0,P=void 0,Q=void 0,R=void 0,S=[s,r],T=[t,u];return M={initialize:a,checkInitialMediaSettingsForType:b,addTrack:c,getTracksFor:d,getCurrentTrackFor:e,isCurrentTrack:f,setTrack:h,setInitialSettings:j,getInitialSettings:k,setSwitchMode:l,getSwitchMode:n,setSelectionModeForInitialTrack:p,getSelectionModeForInitialTrack:w,isMultiTrackSupportedByType:x,isTracksEqual:y,setConfig:z,reset:A}}Object.defineProperty(c,"__esModule",{value:!0});var f=a("../../core/events/Events.js"),g=d(f),h=a("../../core/EventBus.js"),i=d(h),j=a("../../core/FactoryMaker.js"),k=d(j),l=a("../../core/Debug.js"),m=d(l),n=a("../TextSourceBuffer.js"),o=d(n),p=a("../utils/DOMStorage.js"),q=d(p),r="neverReplace",s="alwaysReplace",t="highestBitrate",u="widestRange",v=t;e.__dashjs_factory_name="MediaController";var w=k["default"].getSingletonFactory(e);w.TRACK_SWITCH_MODE_NEVER_REPLACE=r,w.TRACK_SWITCH_MODE_ALWAYS_REPLACE=s,w.TRACK_SELECTION_MODE_HIGHEST_BITRATE=t,w.TRACK_SELECTION_MODE_WIDEST_RANGE=u,w.DEFAULT_INIT_TRACK_SELECTION_MODE=v,c["default"]=w,b.exports=c["default"]},{"../../core/Debug.js":7,"../../core/EventBus.js":8,"../../core/FactoryMaker.js":9,"../../core/events/Events.js":11,"../TextSourceBuffer.js":44,"../utils/DOMStorage.js":138}],56:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(){function a(){var a="WebKitMediaSource"in window,b="MediaSource"in window;return b?new MediaSource:a?new WebKitMediaSource:null}function b(a,b){var c=window.URL.createObjectURL(a);return b.setSource(c),c}function c(a){a.setSource(null)}function d(a,b){return a.duration!=b&&(a.duration=b),a.duration}function e(a){var b=a.sourceBuffers,c=b.length,d=0;if("open"===a.readyState){for(d;c>d;d++){if(b[d].updating)return;if(0===b[d].buffered.length)return}a.endOfStream()}}var f=void 0;return f={createMediaSource:a,attachMediaSource:b,detachMediaSource:c,setDuration:d,signalEndOfStream:e}}Object.defineProperty(c,"__esModule",{value:!0});var f=a("../../core/FactoryMaker.js"),g=d(f);e.__dashjs_factory_name="MediaSourceController",c["default"]=g["default"].getSingletonFactory(e),b.exports=c["default"]},{"../../core/FactoryMaker.js":9}],57:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(){function a(){ma=0,na=NaN,oa=null,ra=null,ta=!1,pa={},sa=(0,k["default"])(_).getInstance()}function b(a){qa=a,da=la.getElement(),Z(),ra=qa.manifestInfo.isDynamic,na=qa.start,ba.on(o["default"].DATA_UPDATE_COMPLETED,I,this),ba.on(o["default"].LIVE_EDGE_SEARCH_COMPLETED,J,this),ba.on(o["default"].BYTES_APPENDED,X,this),ba.on(o["default"].BUFFER_LEVEL_STATE_CHANGED,Y,this),ba.on(o["default"].PERIOD_SWITCH_STARTED,c,this),ta&&(ta=!1,j())}function c(a){a.fromStreamInfo&&pa[a.fromStreamInfo.id]&&delete pa[a.fromStreamInfo.id]}function d(){return C(!0)+qa.duration-r()}function e(){return r()>0}function f(){return qa.id}function h(){return qa.duration}function j(){da?(da.autoplay=!0,da.play()):ta=!0}function l(){return da?da.paused:void 0}function n(){da&&(da.pause(),da.autoplay=!1)}function p(){return da?da.seeking:void 0}function q(a){la&&(aa("Requesting seek to time: "+a),la.setCurrentTime(a))}function r(){return da?da.currentTime:void 0}function t(){return da?da.playbackRate:void 0}function u(){return da?da.played:void 0}function v(){return da?da.ended:void 0}function w(){return ra}function x(a){na=a}function y(){return na}function z(a,b){var c=ja.getMpd(ia.getValue()),d=void 0,e=10;d=sa.getUseSuggestedPresentationDelay()&&c.hasOwnProperty("suggestedPresentationDelay")?c.suggestedPresentationDelay:sa.getLiveDelay()?sa.getLiveDelay():isNaN(a)?2*qa.manifestInfo.minBufferTime:a*sa.getLiveDelayFragmentCount();var f=Math.max(b-e,b/2);return Math.min(d,f)}function A(){la&&da&&(ba.off(o["default"].DATA_UPDATE_COMPLETED,I,this),ba.off(o["default"].BUFFER_LEVEL_STATE_CHANGED,Y,this),ba.off(o["default"].LIVE_EDGE_SEARCH_COMPLETED,J,this),ba.off(o["default"].BYTES_APPENDED,X,this),F(),$()),la=null,qa=null,da=null,ra=null,a()}function B(a){a&&(a.streamController&&(ea=a.streamController),a.timelineConverter&&(fa=a.timelineConverter),a.metricsModel&&(ga=a.metricsModel),a.dashMetrics&&(ha=a.dashMetrics),a.manifestModel&&(ia=a.manifestModel),a.dashManifestModel&&(ja=a.dashManifestModel),a.adapter&&(ka=a.adapter),a.videoModel&&(la=a.videoModel))}function C(a){var b=void 0,c=a?NaN:parseInt((0,i["default"])(_).getInstance().getURIFragmentData().s,10);if(ra)!isNaN(c)&&c>1262304e3&&(b=c-qa.manifestInfo.availableFrom.getTime()/1e3,(b>na||b=0)b=c;else{var d=pa[qa.id];void 0===d&&(d=ea.getActiveStreamCommonEarliestTime()),b=Math.max(d,qa.start)}return b}function D(a){var b,c=ga.getReadOnlyMetricsFor("video")||ga.getReadOnlyMetricsFor("audio"),d=ha.getCurrentDVRInfo(c),e=d?d.range:null;return e?a>=e.start&&a<=e.end?a:b=Math.max(e.end-2*qa.manifestInfo.minBufferTime,e.start):NaN}function E(){if(null===oa){var a=function(){W()};oa=setInterval(a,sa.getWallclockTimeUpdateInterval())}}function F(){clearInterval(oa),oa=null}function G(){var a=C(!1);a>0&&(q(a),aa("Starting playback at offset: "+a))}function H(){if(!l()&&ra&&0!==da.readyState){var a=r(),b=D(a),c=!isNaN(b)&&b!==a;c&&q(b)}}function I(a){if(!a.error){var b=ka.convertDataToTrack(ia.getValue(),a.currentRepresentation),c=b.mediaInfo.streamInfo;qa.id===c.id&&(qa=c,H())}}function J(a){a.error||0===da.readyState||G()}function K(){ba.trigger(o["default"].CAN_PLAY)}function L(){aa("Native video element event: play"),H(),E(),ba.trigger(o["default"].PLAYBACK_STARTED,{startTime:r()})}function M(){aa("Native video element event: playing"),ba.trigger(o["default"].PLAYBACK_PLAYING,{playingTime:r()})}function N(){aa("Native video element event: pause"),ba.trigger(o["default"].PLAYBACK_PAUSED,{ended:v()})}function O(){var a=r();aa("Seeking to: "+a),E(),ba.trigger(o["default"].PLAYBACK_SEEKING,{seekTime:a})}function P(){aa("Native video element event: seeked"),ba.trigger(o["default"].PLAYBACK_SEEKED)}function Q(){var a=r();a!==ma&&(ma=a,ba.trigger(o["default"].PLAYBACK_TIME_UPDATED,{timeToEnd:d(),time:a}))}function R(){ba.trigger(o["default"].PLAYBACK_PROGRESS)}function S(){var a=t();aa("Native video element event: ratechange: ",a),ba.trigger(o["default"].PLAYBACK_RATE_CHANGED,{playbackRate:a})}function T(){aa("Native video element event: loadedmetadata"),(!ra&&qa.isFirst||fa.isTimeSyncCompleted())&&G(),ba.trigger(o["default"].PLAYBACK_METADATA_LOADED),E()}function U(){aa("Native video element event: ended"),n(),F(),ba.trigger(o["default"].PLAYBACK_ENDED)}function V(a){var b=a.target||a.srcElement;ba.trigger(o["default"].PLAYBACK_ERROR,{error:b.error})}function W(){ba.trigger(o["default"].WALLCLOCK_TIME_UPDATED,{isDynamic:ra,time:new Date})}function X(a){var b=a.bufferedRanges;if(b&&b.length){var c=Math.max(b.start(0),qa.start),d=void 0===pa[qa.id]?c:Math.max(pa[qa.id],c);d!==pa[qa.id]&&(!ra&&C(!0)d;d++)b=a[d],c=b.startTime+b.duration/2+f,b=ea.getFragmentRequestForTime(Aa,oa,c,{timeThreshold:0,ignoreIsFinished:!0}),b&&ma.executeRequest(b)}function l(){if(!(qa||ya.isPaused()&&!Ga)){var a=Ea.execute(Aa);if(!a||ua||!ga.getIsTextTrack(ka)&&Da.getIsAppendingInProgress())n(1e3);else{ua=!0;var b=function(){var a=Fa.execute(Aa);a?ma.executeRequest(a):(ua=!1,n(1e3))};za.getPlaybackQuality(Aa,b)}}}function n(a){wa=setTimeout(l,a)}function p(a){if(ka===a.mediaType&&Aa.getStreamInfo().id===a.streamInfo.id){if(oa=Aa.getRepresentationInfoForQuality(a.newQuality),null===oa||void 0===oa)throw"Unexpected error! - currentRepresentationInfo is null or undefined";d(new Date,g["default"].Trace.REPRESENTATION_SWITCH_STOP_REASON),L()}}function r(a){a.error||(oa=ea.convertDataToTrack(da.getValue(),a.currentRepresentation))}function t(a){a.error||(oa=Aa.getCurrentRepresentationInfo(),na&&null===Ca.getLiveEdge()||(la=!0),e())}function v(a){a.fragmentModel===ma&&(f(),aa("Stream is complete"))}function x(a){a.sender===ma&&(isNaN(a.request.index)||(ua=!1),a.error&&a.serviceLocation&&!qa&&j([a.request]))}function z(a){a.sender.getStreamProcessor()===Aa&&l()}function B(a){a.sender.getStreamProcessor()===Aa&&f()}function D(a){a.sender.getStreamProcessor()===Aa&&h(a.requiredQuality)}function F(a){a.sender.getStreamProcessor()===Aa&&(ma.removeExecutedRequestsBeforeTime(a.to),a.hasEnoughSpaceToAppend&&!Da.getIsBufferingCompleted()&&e())}function H(a){a.sender.getStreamProcessor()!==Aa||a.state!==m["default"].BUFFER_EMPTY||ya.isSeeking()||(aa("Stalling Buffer"),d(new Date,g["default"].Trace.REBUFFERING_REASON))}function J(a){a.sender.getStreamProcessor()===Aa&&f()}function K(){ma.abortRequests(),f()}function L(){ra&&ta===!0&&oa&&(ta=!1,sa=new g["default"].Trace,sa.representationid=oa.id,sa.start=new Date,sa.mstart=1e3*ya.getTime(),sa.playbackspeed=ya.getPlaybackRate().toString())}function N(a){a.sender.getStreamProcessor()===Aa&&h(a.index)}function O(){e()}function P(a){xa=a.seekTime,pa||(ua=!1),qa&&e();var b=ca.getMetricsFor("stream"),c=fa.getCurrentManifestUpdate(b),d=oa.DVRWindow?oa.DVRWindow.end-ya.getTime():NaN;ca.updateManifestUpdateInfo(c,{latency:d})}function Q(a){sa&&(sa.playbackspeed=a.playbackRate.toString())}function R(a){if(!a.error){var b=a.liveEdge,c=oa.mediaInfo.streamInfo.manifestInfo,d=b-ya.computeLiveDelay(oa.fragmentDuration,c.DVRWindowSize/2),f=ca.getMetricsFor("stream"),g=fa.getCurrentManifestUpdate(f),h=ya.getLiveStartTime(),i=void 0,j=void 0;i=ea.getFragmentRequestForTime(Aa,oa,d,{ignoreIsFinished:!0}),j=i.startTime,xa=j,(isNaN(h)||j>h)&&ya.setLiveStartTime(j),ca.updateManifestUpdateInfo(g,{currentTime:j,presentationStartTime:b,latency:b-j,clientTimeOffset:ha.getClientTimeOffset()}),la=!0,e()}}function S(){return xa}function T(a){xa=a}function U(){return ma}function V(a){va=a}function W(){return va}function X(){return Aa}function Y(a){ra=a}function Z(a,b){d(a,b),ra=null}function $(){ba.off(I["default"].LIVE_EDGE_SEARCH_COMPLETED,R,this),ba.off(I["default"].DATA_UPDATE_STARTED,B,this),ba.off(I["default"].DATA_UPDATE_COMPLETED,r,this),ba.off(I["default"].BUFFER_LEVEL_STATE_CHANGED,H,this),ba.off(I["default"].QUALITY_CHANGED,p,this),ba.off(I["default"].FRAGMENT_LOADING_COMPLETED,x,this),ba.off(I["default"].STREAM_COMPLETED,v,this),ba.off(I["default"].STREAM_INITIALIZED,t,this),ba.off(I["default"].QUOTA_EXCEEDED,J,this),ba.off(I["default"].BYTES_APPENDED,z,this),ba.off(I["default"].BUFFER_CLEARED,F,this),ba.off(I["default"].INIT_REQUESTED,D,this),ba.off(I["default"].PLAYBACK_RATE_CHANGED,Q,this),ba.off(I["default"].PLAYBACK_SEEKING,P,this),ba.off(I["default"].PLAYBACK_STARTED,O,this),ba.off(I["default"].URL_RESOLUTION_FAILED,K,this),ga.getIsTextTrack(ka)&&ba.off(I["default"].TIMED_TEXT_REQUESTED,N,this),f(),Ba.detachModel(ma),ua=!1,va=0,xa=NaN,ya=null,ra=null}var _=this.context,aa=(0,M["default"])(_).getInstance().log,ba=(0,G["default"])(_).getInstance(),ca=a.metricsModel,da=a.manifestModel,ea=a.adapter,fa=a.dashMetrics,ga=a.dashManifestModel,ha=a.timelineConverter,ia=a.mediaPlayerModel,ja=void 0,ka=void 0,la=void 0,ma=void 0,na=void 0,oa=void 0,pa=void 0,qa=void 0,ra=void 0,sa=void 0,ta=void 0,ua=void 0,va=void 0,wa=void 0,xa=void 0,ya=void 0,za=void 0,Aa=void 0,Ba=void 0,Ca=void 0,Da=void 0,Ea=void 0,Fa=void 0,Ga=void 0;return ja={initialize:c,getStreamProcessor:X,getSeekTarget:S,setSeekTarget:T,getFragmentModel:U,setTimeToLoadDelay:V,getTimeToLoadDelay:W,replaceCanceledRequests:j,start:e,stop:f,reset:$,setPlayList:Y,finalisePlayList:Z},b(),ja}Object.defineProperty(c,"__esModule",{value:!0});var f=a("../vo/metrics/PlayList.js"),g=d(f),h=a("./PlaybackController.js"),i=d(h),j=a("./AbrController.js"),k=d(j),l=a("./BufferController.js"),m=d(l),n=a("../rules/scheduling/BufferLevelRule.js"),o=d(n),p=a("../rules/scheduling/NextFragmentRequestRule.js"),q=d(p),r=a("../TextSourceBuffer.js"),s=d(r),t=a("../models/MetricsModel.js"),u=d(t),v=a("../../dash/DashMetrics.js"),w=d(v),x=a("../../dash/DashAdapter.js"),y=d(x),z=a("../controllers/SourceBufferController.js"),A=d(z),B=a("../VirtualBuffer.js"),C=d(B),D=a("../utils/LiveEdgeFinder.js"),E=d(D),F=a("../../core/EventBus.js"),G=d(F),H=a("../../core/events/Events.js"),I=d(H),J=a("../../core/FactoryMaker.js"),K=d(J),L=a("../../core/Debug.js"),M=d(L);e.__dashjs_factory_name="ScheduleController",c["default"]=K["default"].getClassFactory(e),b.exports=c["default"]},{"../../core/Debug.js":7,"../../core/EventBus.js":8,"../../core/FactoryMaker.js":9,"../../core/events/Events.js":11,"../../dash/DashAdapter.js":13,"../../dash/DashMetrics.js":15,"../TextSourceBuffer.js":44,"../VirtualBuffer.js":46,"../controllers/SourceBufferController.js":59,"../models/MetricsModel.js":91,"../rules/scheduling/BufferLevelRule.js":129,"../rules/scheduling/NextFragmentRequestRule.js":130,"../utils/LiveEdgeFinder.js":141,"../vo/metrics/PlayList.js":168,"./AbrController.js":49,"./BufferController.js":52,"./PlaybackController.js":57}],59:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(){function a(a,b){var c=b.codec,d=null;try{if(c.match(/application\/mp4;\s*codecs="(stpp|wvtt)"/i))throw new y["default"]("not really supported");d=a.addSourceBuffer(c)}catch(e){if(!b.isText&&-1===c.indexOf('codecs="stpp"')&&-1===c.indexOf('codecs="wvtt"'))throw e;d=(0,g["default"])(t).getInstance(),d.setConfig({errHandler:(0,m["default"])(t).getInstance(),adapter:(0,k["default"])(t).getInstance(),dashManifestModel:z,mediaController:(0,i["default"])(t).getInstance(),videoModel:(0,w["default"])(t).getInstance(),streamController:(0,o["default"])(t).getInstance(),textTracks:(0,q["default"])(t).getInstance(),VTTParser:(0,s["default"])(t).getInstance(),TTMLParser:(0, +u["default"])(t).getInstance()})}return d}function b(a,b){try{a.removeSourceBuffer(b)}catch(c){}}function c(a,b,c){var d,e,f=null,g=0,h=0,i=null,j=null,k=0,l=c||.15;try{f=a.buffered}catch(m){return null}if(null!==f&&void 0!==f){for(e=0,d=f.length;d>e;e++)if(g=f.start(e),h=f.end(e),null===i)k=Math.abs(g-b),b>=g&&h>b?(i=g,j=h):l>=k&&(i=g,j=h);else{if(k=g-j,!(l>=k))break;j=h}if(null!==i)return{start:i,end:j}}return null}function d(a){var b=null;try{return b=a.buffered}catch(c){return null}}function e(a){var b,c,e=d(a),f=0;if(!e)return f;for(c=0,b=e.length;b>c;c++)f+=e.end(c)-e.start(c);return f}function f(a,b,d){var e,f;return e=c(a,b,d),f=null===e?0:e.end-b}function h(a,b){if(!b)return null;var c,e,f,g,h,i,j,k,l,m=d(b);if(!m)return null;for(var n=0,o=m.length;o>n;n++){if(k=a.length>n,h=k?{start:a.start(n),end:a.end(n)}:null,c=m.start(n),e=m.end(n),!h)return l={start:c,end:e};if(f=h.start===c,g=h.end===e,!f||!g){if(f)l={start:h.end,end:e};else{if(!g)return l={start:c,end:e};l={start:c,end:h.start}}return i=a.length>n+1?{start:a.start(n+1),end:a.end(n+1)}:null,j=o>n+1?{start:m.start(n+1),end:m.end(n+1)}:null,!i||j&&j.start===i.start&&j.end===i.end||(l.end=i.start),l}}return null}function j(a,b){var c=b.bytes,d="append"in a?"append":"appendBuffer"in a?"appendBuffer":null,e="Object"===Object.prototype.toString.call(a).slice(8,-1);if(d)try{r(a,function(){e?a[d](c,b):a[d](c),r(a,function(){v.trigger(C["default"].SOURCEBUFFER_APPEND_COMPLETED,{buffer:a,bytes:c})})})}catch(f){v.trigger(C["default"].SOURCEBUFFER_APPEND_COMPLETED,{buffer:a,bytes:c,error:new y["default"](f.code,f.message,null)})}}function l(a,b,c,d){try{r(a,function(){b>=0&&c>b&&"ended"!==d.readyState&&a.remove(b,c),r(a,function(){v.trigger(C["default"].SOURCEBUFFER_REMOVE_COMPLETED,{buffer:a,from:b,to:c})})})}catch(e){v.trigger(C["default"].SOURCEBUFFER_REMOVE_COMPLETED,{buffer:a,from:b,to:c,error:new y["default"](e.code,e.message,null)})}}function n(a,b){try{"open"===a.readyState&&b.abort()}catch(c){}}function p(a){a&&a.dashManifestModel&&(z=a.dashManifestModel)}function r(a,b){var c,d=50,e=function(){a.updating||(clearInterval(c),b())},f=function h(){a.updating||(a.removeEventListener("updateend",h,!1),b())};if(!a.updating)return void b();if("function"==typeof a.addEventListener)try{a.addEventListener("updateend",f,!1)}catch(g){c=setInterval(e,d)}else c=setInterval(e,d)}var t=this.context,v=(0,A["default"])(t).getInstance(),x=void 0,z=void 0;return x={append:j,remove:l,abort:n,createSourceBuffer:a,removeSourceBuffer:b,getBufferRange:c,getAllRanges:d,getTotalBufferedTime:e,getBufferLength:f,getRangeDifference:h,setConfig:p}}Object.defineProperty(c,"__esModule",{value:!0});var f=a("../TextSourceBuffer.js"),g=d(f),h=a("./MediaController.js"),i=d(h),j=a("../../dash/DashAdapter.js"),k=d(j),l=a("../utils/ErrorHandler.js"),m=d(l),n=a("./StreamController.js"),o=d(n),p=a("../TextTracks.js"),q=d(p),r=a("../utils/VTTParser.js"),s=d(r),t=a("../utils/TTMLParser.js"),u=d(t),v=a("../models/VideoModel.js"),w=d(v),x=a("../vo/Error.js"),y=d(x),z=a("../../core/EventBus.js"),A=d(z),B=a("../../core/events/Events.js"),C=d(B),D=a("../../core/FactoryMaker.js"),E=d(D),F=22;e.__dashjs_factory_name="SourceBufferController";var G=E["default"].getSingletonFactory(e);G.QUOTA_EXCEEDED_ERROR_CODE=F,c["default"]=G,b.exports=c["default"]},{"../../core/EventBus.js":8,"../../core/FactoryMaker.js":9,"../../core/events/Events.js":11,"../../dash/DashAdapter.js":13,"../TextSourceBuffer.js":44,"../TextTracks.js":45,"../models/VideoModel.js":93,"../utils/ErrorHandler.js":139,"../utils/TTMLParser.js":144,"../utils/VTTParser.js":146,"../vo/Error.js":149,"./MediaController.js":55,"./StreamController.js":60}],60:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(){function a(){la=null,ja=[],va=(0,u["default"])(S).getInstance(),na=!0,oa=!1,pa=!1,wa=!1,xa=!0,ya=null,qa=!1,ra=!1}function b(a,b){na=a,ma=b,ia.initialize(),X=(0,k["default"])(S).getInstance(),X.setConfig({log:T,manifestModel:Z,dashManifestModel:$}),X.initialize(Y),ta=(0,s["default"])(S).getInstance(),ua=(0,g["default"])(S).getInstance(),ua.setConfig({streamController:V,timelineConverter:ia,metricsModel:aa,dashMetrics:ba,manifestModel:Z,dashManifestModel:$,adapter:_,videoModel:ta}),U.on(o["default"].TIME_SYNCHRONIZATION_COMPLETED,H,this),U.on(o["default"].PLAYBACK_SEEKING,n,this),U.on(o["default"].PLAYBACK_TIME_UPDATED,j,this),U.on(o["default"].PLAYBACK_ENDED,l,this),U.on(o["default"].PLAYBACK_ERROR,h,this),U.on(o["default"].PLAYBACK_STARTED,p,this),U.on(o["default"].PLAYBACK_PAUSED,r,this),U.on(o["default"].MANIFEST_UPDATED,I,this),U.on(o["default"].STREAM_BUFFERING_COMPLETED,t,this)}function c(a,b){b=b||new Date,ya&&(ka&&ka.getProcessors().forEach(function(c){var d=c.getScheduleController();d&&d.finalisePlayList(b,a)}),aa.addPlayList(ya),ya=null)}function d(a){ya=new y["default"],ya.start=new Date,ya.mstart=1e3*ua.getTime(),ya.starttype=a,ka&&ka.getProcessors().forEach(function(a){var b=a.getScheduleController();b&&b.setPlayList(ya)})}function e(a,b,c){U.trigger(a,{fromStreamInfo:b?b.getStreamInfo():null,toStreamInfo:c.getStreamInfo()})}function f(){ka.isActivated()&&xa&&0===ka.getStreamInfo().index&&(ka.startEventController(),na&&ua.play())}function h(a){var b=a.error?a.error.code:0,c="";if(-1!==b){switch(b){case 1:c="MEDIA_ERR_ABORTED";break;case 2:c="MEDIA_ERR_NETWORK";break;case 3:c="MEDIA_ERR_DECODE";break;case 4:c="MEDIA_ERR_SRC_NOT_SUPPORTED";break;case 5:c="MEDIA_ERR_ENCRYPTED";break;default:c="UNKNOWN"}qa=!0,a.error.msExtendedCode&&(c+=" (0x"+(a.error.msExtendedCode>>>0).toString(16).toUpperCase()+")"),T("Video Element Error: "+c),a.error&&T(a.error),ha.mediaSourceError(c),Q()}}function j(a){var b=ta.getPlaybackQuality();b&&aa.addDroppedFrames("video",b),ua.isSeeking()||a.timeToEnd0&&(b+=ja[0].getStartTime());for(var e=0;d>e;e++)if(c=ja[e],b+=c.getDuration(),b>a)return c;return null}function x(a,b){for(var c=null,d=0,e=0,f=null,g=ja.length,h=0;g>h;h++){if(c=ja[h],e=c.getStartTime(),f=c.getDuration(),Number.isFinite(e)&&(d=e),c.getId()===b)return a-d;Number.isFinite(f)&&(d+=f)}return null}function z(){var a=[];return ka.getProcessors().forEach(function(b){a.push(b.getIndexHandler().getEarliestTime())}),Math.min.apply(Math,a)}function B(a,b,c){function d(){isNaN(c)?!function(){var a=ua.getStreamStartTime(!0);ka.getProcessors().forEach(function(b){_.setIndexHandlerTime(b,a)}),ua.seek(a)}():ua.seek(c),ua.play(),ka.startEventController(),oa=!1,e(o["default"].PERIOD_SWITCH_COMPLETED,a,b)}!oa&&a&&b&&a!==b&&(oa=!0,e(o["default"].PERIOD_SWITCH_STARTED,a,b),a.deactivate(),ka=b,ua.initialize(ka.getStreamInfo()),C(d))}function C(a){function b(){T("MediaSource is open!"),window.URL.revokeObjectURL(c),sa.removeEventListener("sourceopen",b),sa.removeEventListener("webkitsourceopen",b),D(),ka.activate(sa),a&&a()}var c=void 0;sa?da.detachMediaSource(ta):sa=da.createMediaSource(),sa.addEventListener("sourceopen",b,!1),sa.addEventListener("webkitsourceopen",b,!1),c=da.attachMediaSource(sa,ta),T("MediaSource attached to element. Waiting on open...")}function D(){var a,b;a=ka.getStreamInfo().manifestInfo.duration,b=da.setDuration(sa,a),T("Duration successfully set to: "+b)}function E(){var a,b,c,d,f,g,h,j=Z.getValue(),k=aa.getMetricsFor("stream"),l=ba.getCurrentManifestUpdate(k),m=[];if(j){g=_.getStreamsInfo(j),la&&(U.trigger(o["default"].PROTECTION_CREATED,{controller:la,manifest:j}),la.setMediaElement(ta.getElement()),ma&&la.setProtectionData(ma));try{if(0===g.length)throw new Error("There are no streams");for(aa.updateManifestUpdateInfo(l,{currentTime:ua.getTime(),buffered:ta.getElement().buffered,presentationStartTime:g[0].start,clientTimeOffset:ia.getClientTimeOffset()}),pa=!0,d=0,b=g.length;b>d;d++){for(a=g[d],f=0,c=ja.length;c>f;f++)ja[f].getId()===a.id&&(h=ja[f],m.push(h),h.updateData(a));h||(h=(0,i["default"])(S).create({manifestModel:Z,manifestUpdater:X,adapter:_,timelineConverter:ia,capabilities:W,errHandler:ha,baseURLController:fa}),h.initialize(a,la),U.on(o["default"].STREAM_INITIALIZED,G,this),m.push(h),ka&&h.updateData(a)),aa.addManifestUpdateStreamInfo(l,a.id,a.index,a.start,a.duration),h=null}ja=m,ka||(ka=ja[0],e(o["default"].PERIOD_SWITCH_STARTED,null,ka),ua.initialize(ka.getStreamInfo()),e(o["default"].PERIOD_SWITCH_COMPLETED,null,ka)),sa||C(),pa=!1,F()}catch(n){ha.manifestError(n.message,"nostreamscomposed",j),ra=!0,Q()}}}function F(){if(!pa){var a=ja.length,b=0;for(f(),b;a>b;b++)if(!ja[b].isInitialized())return;U.trigger(o["default"].STREAMS_COMPOSED)}}function G(){F()}function H(){E()}function I(a){if(a.error)ra=!0,Q();else{var b,c,d=a.manifest,e=_.getStreamsInfo(d)[0],f=_.getMediaInfoForType(d,e,"video")||_.getMediaInfoForType(d,e,"audio");f&&(b=_.getDataForMedia(f),c=$.getRepresentationsForAdaptation(d,b)[0].useCalculatedLiveEdgeTime,c&&(T("SegmentTimeline detected using calculated Live Edge Time"),va.setUseManifestDateHeaderTimeSource(!1)));var g=$.getUTCTimingSources(a.manifest),h=!$.getIsDynamic(d)||c?g:g.concat(va.getUTCTimingSources()),i=(0,q["default"])(S).getInstance().isManifestHTTPS();h.forEach(function(a){a.value.replace(/.*?:\/\//g,"")===u["default"].DEFAULT_UTC_TIMING_SOURCE.value.replace(/.*?:\/\//g,"")&&(a.value=a.value.replace(i?new RegExp(/^(http:)?\/\//i):new RegExp(/^(https:)?\/\//i),i?"https://":"http://"),T("Matching default timing source protocol to manifest protocol: ",a.value))}),fa.initialize(d),ea.setConfig({metricsModel:aa,dashMetrics:ba}),ea.initialize(h,va.getUseManifestDateHeaderTimeSource())}}function J(){return na}function K(){return ka?ka.getStreamInfo():null}function L(a){return ka.getId()===a.id}function M(a){return ja.filter(function(b){return b.getId()===a})[0]}function N(a){Y.load(a)}function O(a){X.setManifest(a)}function P(a){a&&(a.capabilities&&(W=a.capabilities),a.manifestLoader&&(Y=a.manifestLoader),a.manifestModel&&(Z=a.manifestModel),a.dashManifestModel&&($=a.dashManifestModel),a.protectionController&&(la=a.protectionController),a.adapter&&(_=a.adapter),a.metricsModel&&(aa=a.metricsModel),a.dashMetrics&&(ba=a.dashMetrics),a.liveEdgeFinder&&(ca=a.liveEdgeFinder),a.mediaSourceController&&(da=a.mediaSourceController),a.timeSyncController&&(ea=a.timeSyncController),a.baseURLController&&(fa=a.baseURLController),a.virtualBuffer&&(ga=a.virtualBuffer),a.errHandler&&(ha=a.errHandler),a.timelineConverter&&(ia=a.timelineConverter))}function Q(){ea.reset(),c(qa||ra?y["default"].Trace.FAILURE_STOP_REASON:y["default"].Trace.USER_REQUEST_STOP_REASON);for(var a=0,b=ja.length;b>a;a++){var d=ja[a];U.off(o["default"].STREAM_INITIALIZED,G,this),d.reset(qa)}ja=[],U.off(o["default"].PLAYBACK_TIME_UPDATED,j,this),U.off(o["default"].PLAYBACK_SEEKING,n,this),U.off(o["default"].PLAYBACK_ERROR,h,this),U.off(o["default"].PLAYBACK_STARTED,p,this),U.off(o["default"].PLAYBACK_PAUSED,r,this),U.off(o["default"].PLAYBACK_ENDED,l,this),U.off(o["default"].MANIFEST_UPDATED,I,this),U.off(o["default"].STREAM_BUFFERING_COMPLETED,t,this),fa.reset(),X.reset(),aa.clearAllCurrentMetrics(),Z.setValue(null),Y.reset(),ia.reset(),ca.reset(),_.reset(),ga.reset(),oa=!1,pa=!1,ka=null,qa=!1,ra=!1,xa=!0,wa=!1,sa&&(da.detachMediaSource(ta),sa=null),ta=null,la&&(la.setMediaElement(null),la=null,ma=null,Z.getValue()&&U.trigger(o["default"].PROTECTION_DESTROYED,{data:Z.getValue().url})),U.trigger(o["default"].STREAM_TEARDOWN_COMPLETE)}var R=1,S=this.context,T=(0,A["default"])(S).getInstance().log,U=(0,m["default"])(S).getInstance(),V=void 0,W=void 0,X=void 0,Y=void 0,Z=void 0,$=void 0,_=void 0,aa=void 0,ba=void 0,ca=void 0,da=void 0,ea=void 0,fa=void 0,ga=void 0,ha=void 0,ia=void 0,ja=void 0,ka=void 0,la=void 0,ma=void 0,na=void 0,oa=void 0,pa=void 0,qa=void 0,ra=void 0,sa=void 0,ta=void 0,ua=void 0,va=void 0,wa=void 0,xa=void 0,ya=void 0;return V={initialize:b,getAutoPlay:J,getActiveStreamInfo:K,isStreamActive:L,getStreamById:M,getTimeRelativeToStreamId:x,load:N,loadWithManifest:O,getActiveStreamCommonEarliestTime:z,setConfig:P,reset:Q},a(),V}Object.defineProperty(c,"__esModule",{value:!0});var f=a("./PlaybackController.js"),g=d(f),h=a("../Stream.js"),i=d(h),j=a("../ManifestUpdater.js"),k=d(j),l=a("../../core/EventBus.js"),m=d(l),n=a("../../core/events/Events.js"),o=d(n),p=a("../models/URIQueryAndFragmentModel.js"),q=d(p),r=a("../models/VideoModel.js"),s=d(r),t=a("../models/MediaPlayerModel.js"),u=d(t),v=a("../../core/FactoryMaker.js"),w=d(v),x=a("../vo/metrics/PlayList.js"),y=d(x),z=a("../../core/Debug.js"),A=d(z);e.__dashjs_factory_name="StreamController",c["default"]=w["default"].getSingletonFactory(e),b.exports=c["default"]},{"../../core/Debug.js":7,"../../core/EventBus.js":8,"../../core/FactoryMaker.js":9,"../../core/events/Events.js":11,"../ManifestUpdater.js":38,"../Stream.js":42,"../models/MediaPlayerModel.js":90,"../models/URIQueryAndFragmentModel.js":92,"../models/VideoModel.js":93,"../vo/metrics/PlayList.js":168,"./PlaybackController.js":57}],61:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a){function b(){s=!1,t=null,u=null,v=null,w=null,x=null,o.on(i["default"].DATA_UPDATE_COMPLETED,l,this),o.on(i["default"].INIT_FRAGMENT_LOADED,m,this)}function c(a,b,c){v=a,h(b),w=c,x=w.getRepresentationController()}function d(a){try{u=p.createSourceBuffer(t,a),s||(u.hasOwnProperty("initialize")&&u.initialize(v,this),s=!0)}catch(b){q.mediaSourceError("Error creating "+v+" source buffer.")}return u}function e(){return u}function f(a){u=a}function h(a){t=a}function j(){return w}function k(a){o.off(i["default"].DATA_UPDATE_COMPLETED,l,this),o.off(i["default"].INIT_FRAGMENT_LOADED,m,this),a||(p.abort(t,u),p.removeSourceBuffer(t,u))}function l(a){a.sender.getStreamProcessor()===w&&o.trigger(i["default"].TIMED_TEXT_REQUESTED,{index:0,sender:a.sender})}function m(a){a.fragmentModel===w.getFragmentModel()&&a.chunk.bytes&&p.append(u,a.chunk)}var n=this.context,o=(0,g["default"])(n).getInstance(),p=a.sourceBufferController,q=a.errHandler,r=void 0,s=void 0,t=void 0,u=void 0,v=void 0,w=void 0,x=void 0;return r={initialize:c,createBuffer:d,getBuffer:e,setBuffer:f,getStreamProcessor:j,setMediaSource:h,reset:k},b(),r}Object.defineProperty(c,"__esModule",{value:!0});var f=a("../../core/EventBus.js"),g=d(f),h=a("../../core/events/Events.js"),i=d(h),j=a("../../core/FactoryMaker.js"),k=d(j);e.__dashjs_factory_name="TextController",c["default"]=k["default"].getClassFactory(e),b.exports=c["default"]},{"../../core/EventBus.js":8,"../../core/FactoryMaker.js":9,"../../core/events/Events.js":11}],62:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(){function a(a,b){H=b,E=0,F=!1,G=!1,I={"urn:mpeg:dash:utc:http-head:2014":v,"urn:mpeg:dash:utc:http-xsdate:2014":u.bind(null,m),"urn:mpeg:dash:utc:http-iso:2014":u.bind(null,n),"urn:mpeg:dash:utc:direct:2014":t,"urn:mpeg:dash:utc:http-head:2012":v,"urn:mpeg:dash:utc:http-xsdate:2012":u.bind(null,m),"urn:mpeg:dash:utc:http-iso:2012":u.bind(null,n),"urn:mpeg:dash:utc:direct:2012":t,"urn:mpeg:dash:utc:http-ntp:2014":s,"urn:mpeg:dash:utc:ntp:2014":s,"urn:mpeg:dash:utc:sntp:2014":s},e()||(y(a),f(!0))}function b(a){a&&(a.metricsModel&&(J=a.metricsModel),a.dashMetrics&&(K=a.dashMetrics))}function c(){return j()}function d(a){F=a}function e(){return F}function f(a){G=a}function h(a){E=a}function j(){return E}function l(a){var b,c,d=60,e=60,f=1e3,g=/^([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2})(?::([0-9]*)(\.[0-9]*)?)?(?:([+\-])([0-9]{2})([0-9]{2}))?/,h=g.exec(a);return b=Date.UTC(parseInt(h[1],10),parseInt(h[2],10)-1,parseInt(h[3],10),parseInt(h[4],10),parseInt(h[5],10),h[6]&&(parseInt(h[6],10)||0),h[7]&&parseFloat(h[7])*f||0),h[9]&&h[10]&&(c=parseInt(h[9],10)*e+parseInt(h[10],10),b+=("+"===h[8]?-1:1)*c*d*f),new Date(b).getTime()}function m(a){var b=Date.parse(a);return isNaN(b)&&(b=l(a)),b}function n(a){return Date.parse(a)}function r(a){return Date.parse(a)}function s(a,b,c){c()}function t(a,b,c){var d=m(a);return isNaN(d)?void c():void b(d)}function u(a,b,c,d,e){var f,g,h=!1,i=new XMLHttpRequest,j=e?"HEAD":"GET",k=b.match(/\S+/g);b=k.shift(),f=function(){h||(h=!0,k.length?u(a,k.join(" "),c,d,e):d())},g=function(){var b,d;200===i.status&&(b=e?i.getResponseHeader("Date"):i.response,d=a(b),isNaN(d)||(c(d),h=!0))},i.open(j,b),i.timeout=q||0,i.onload=g,i.onloadend=f,i.send()}function v(a,b,c){u(r,a,b,c,!0)}function w(){var a=J.getReadOnlyMetricsFor("stream"),b=K.getLatestMPDRequestHeaderValueByID(a,"Date"),c=null!==b?new Date(b).getTime():Number.NaN;isNaN(c)?x(!0):(h(c-(new Date).getTime()),x(!1,c/1e3,E))}function x(a,b,c){d(!1),C.trigger(k["default"].TIME_SYNCHRONIZATION_COMPLETED,{time:b,offset:c,error:a?new g["default"](p):null})}function y(a,b){var c=b||0,e=a[c],f=function(a,b){var c=!a||!b;c&&H?w():x(c,a,b)};d(!0),e?I.hasOwnProperty(e.schemeIdUri)?I[e.schemeIdUri](e.value,function(a){var b=(new Date).getTime(),c=a-b;h(c),B("Local time: "+new Date(b)),B("Server time: "+new Date(a)),B("Difference (ms): "+c),f(a,c)},function(){y(a,c+1)}):y(a,c+1):(h(0),f())}function z(){f(!1),d(!1)}var A=this.context,B=(0,o["default"])(A).getInstance().log,C=(0,i["default"])(A).getInstance(),D=void 0,E=void 0,F=void 0,G=void 0,H=void 0,I=void 0,J=void 0,K=void 0;return D={initialize:a,getOffsetToDeviceTimeMs:c,setConfig:b,reset:z}}Object.defineProperty(c,"__esModule",{value:!0});var f=a("./../vo/Error.js"),g=d(f),h=a("./../../core/EventBus.js"),i=d(h),j=a("./../../core/events/Events.js"),k=d(j),l=a("../../core/FactoryMaker.js"),m=d(l),n=a("../../core/Debug.js"),o=d(n),p=1,q=5e3;e.__dashjs_factory_name="TimeSyncController";var r=m["default"].getSingletonFactory(e);r.TIME_SYNC_FAILED_ERROR_CODE=p,r.HTTP_TIMEOUT_MS=q,c["default"]=r,b.exports=c["default"]},{"../../core/Debug.js":7,"../../core/FactoryMaker.js":9,"./../../core/EventBus.js":8,"./../../core/events/Events.js":11,"./../vo/Error.js":149}],63:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a){function b(){z.on(k["default"].XLINK_ELEMENT_LOADED,j,A),F=(0,g["default"])(y).create({errHandler:a.errHandler,metricsModel:a.metricsModel,requestModifier:a.requestModifier})}function c(a){B=a}function d(a){C=a}function e(a){var b;E=new o["default"](B,"",!0),D=a,b=m(D.Period_asArray,D,r,p),h(b,r,p)}function f(){z.off(k["default"].XLINK_ELEMENT_LOADED,j,A),F&&(F.reset(),F=null)}function h(a,b,c){var d,e,f,g={};for(g.elements=a,g.type=b,g.resolveType=c,0===g.elements.length&&l(g),f=0;f")+1,g=b.resolvedContent.substr(0,d)+e+b.resolvedContent.substr(d)+f,b.resolvedContent=E.xml_str2json(g)),w(c)&&l(c)}function l(a){var b,c,d=[];if(n(a),a.resolveType===q&&z.trigger(k["default"].XLINK_READY,{manifest:D}),a.resolveType===p)switch(a.type){case r:for(b=0;b=0;f--)e=a[f],e.hasOwnProperty("xlink:href")&&e["xlink:href"]===u&&a.splice(f,1);for(f=0;f=0;e--){if(b=a.elements[e],c=b.type+"_asArray",!b.resolvedContent||x())delete b.originalContent["xlink:actuate"],delete b.originalContent["xlink:href"],h.push(b.originalContent);else if(b.resolvedContent)for(f=0;f0&&C.run(D)}function v(a,b,c,d,e,f){return{url:a,parentElement:b,type:c,index:d,resolveType:e,originalContent:f,resolvedContent:null,resolved:!1}}function w(a){var b,c;for(b=0;bc;c+=1){var d=j.start(c),e=j.end(c);if(a>=d&&e>a)return!0}return!1}var f=!1,g=this.context,h=void 0,j=void 0,k=a.mediaElement;return h={initialize:b,reset:c,isEnabled:e},d(),h}Object.defineProperty(c,"__esModule",{value:!0});var f=a("../../../core/FactoryMaker.js"),g=d(f),h=a("../../utils/CustomTimeRanges.js"),i=d(h);e.__dashjs_factory_name="RangeController",c["default"]=g["default"].getClassFactory(e),b.exports=c["default"]},{"../../../core/FactoryMaker.js":9,"../../utils/CustomTimeRanges.js":137}],70:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a){function b(a,b){a.some(function(a){var c=g.create(a,b);return c?(e.push(c),!0):void 0})}function c(){e.forEach(function(a){return a.reset()}),e=[]}function d(a,b){e.forEach(function(c){return c.report(a,b)})}var e=[],f=void 0,g=(0,i["default"])(this.context).getInstance({log:a.log});return f={initialize:b,reset:c,report:d}}Object.defineProperty(c,"__esModule",{value:!0});var f=a("../../../core/FactoryMaker.js"),g=d(f),h=a("../reporting/ReportingFactory.js"),i=d(h);e.__dashjs_factory_name="ReportingController",c["default"]=g["default"].getClassFactory(e),b.exports=c["default"]},{"../../../core/FactoryMaker.js":9,"../reporting/ReportingFactory.js":76}],71:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a){function b(b,c){var d,e=b.match(g);if(e){try{d=j[e[1]](h).create({eventBus:a.eventBus}),d.initialize(e[1],c,e[3],e[5])}catch(i){d=null,f("MetricsHandlerFactory: Could not create handler for type "+e[1]+" with args "+e[3]+", "+e[5]+" ("+i.message+")")}return d}}function c(a,b){j[a]=b}function d(a){delete j[a]}var e=void 0,f=a.log,g=/([a-zA-Z]*)(\(([0-9]*)(\,\s*([a-zA-Z]*))?\))?/,h=this.context,j={BufferLevel:i["default"],DVBErrors:k["default"],HttpList:m["default"],PlayList:o["default"],RepSwitchList:o["default"],TcpList:o["default"]};return e={create:b,register:c,unregister:d}}Object.defineProperty(c,"__esModule",{value:!0});var f=a("../../../core/FactoryMaker.js"),g=d(f),h=a("./handlers/BufferLevelHandler.js"),i=d(h),j=a("./handlers/DVBErrorsHandler.js"),k=d(j),l=a("./handlers/HttpListHandler.js"),m=d(l),n=a("./handlers/GenericMetricHandler.js"),o=d(n);e.__dashjs_factory_name="MetricsHandlerFactory",c["default"]=g["default"].getSingletonFactory(e),b.exports=c["default"]},{"../../../core/FactoryMaker.js":9,"./handlers/BufferLevelHandler.js":72,"./handlers/DVBErrorsHandler.js":73,"./handlers/GenericMetricHandler.js":74,"./handlers/HttpListHandler.js":75}],72:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(){function a(){try{return Object.keys(o).map(function(a){return o[a]}).reduce(function(a,b){return a.level=200&&d.status<300?b&&b():c&&c())};q.push(d);try{d.open("GET",a),d.onloadend=e,d.onerror=e,d.send()}catch(f){d.onerror()}}function b(b,c){Array.isArray(c)||(c=[c]),l&&o.isEnabled()&&c.forEach(function(c){var d=g.serialise(c);j&&"DVBErrors"!==b&&(d="metricname="+b+"&"+d),d=n+"?"+d,a(d,null,function(){l=!1})})}function c(a,b){var c;if(o=b,n=a["dvb:reportingUrl"],!n)throw new Error("required parameter missing (dvb:reportingUrl)");m||(c=a["dvb:probability"]||a["dvb:priority"]||0,c&&(1e3===c||c/1e3>=h.random())&&(l=!0),m=!0)}function d(){p||(q.forEach(function(a){return a.abort()}),q=[]),m=!1,l=!1,n=null,o=null}var e=void 0,f=this.context,g=(0,i["default"])(f).getInstance(),h=(0,k["default"])(f).getInstance(),j=!0,l=!1,m=!1,n=null,o=null,p=!0,q=[];return e={report:b,initialize:c,reset:d}}Object.defineProperty(c,"__esModule",{value:!0});var f=a("../../../../core/FactoryMaker.js"),g=d(f),h=a("../../utils/MetricSerialiser.js"),i=d(h),j=a("../../utils/RNG.js"),k=d(j);e.__dashjs_factory_name="DVBReporting",c["default"]=g["default"].getClassFactory(e),b.exports=c["default"]},{"../../../../core/FactoryMaker.js":9,"../../utils/MetricSerialiser.js":81,"../../utils/RNG.js":82}],78:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a){function b(a){var b=new g["default"];if(r){for(var c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);b.mpdurl||(b.mpdurl=r.originalUrl||r.url),b.terror||(b.terror=new Date),q.addDVBErrors(b)}}function c(a){a.error||(r=a.manifest)}function d(a){b({errorcode:g["default"].BASE_URL_CHANGED,servicelocation:a.entry})}function e(){b({errorcode:g["default"].BECAME_REPORTER})}function f(a){(0===a.responsecode||a.responsecode>=400||a.responsecode<100||a.responsecode>=600)&&b({errorcode:a.responsecode||g["default"].CONNECTION_ERROR,url:a.url,terror:a.tresponse,servicelocation:a._serviceLocation})}function h(a){switch(a.metric){case"HttpList":f(a.value)}}function j(a){var c,d=a.error?a.error.code:0;switch(d){case MediaError.MEDIA_ERR_NETWORK:c=g["default"].CONNECTION_ERROR;break;case MediaError.MEDIA_ERR_DECODE:c=g["default"].CORRUPT_MEDIA_OTHER;break;default:return}b({errorcode:c})}function l(){p.on(i["default"].MANIFEST_UPDATED,c,o),p.on(i["default"].SERVICE_LOCATION_BLACKLIST_CHANGED,d,o),p.on(k["default"].METRIC_ADDED,h,o),p.on(k["default"].METRIC_UPDATED,h,o),p.on(k["default"].PLAYBACK_ERROR,j,o),p.on(m["default"].BECAME_REPORTING_PLAYER,e,o)}function n(){p.off(i["default"].MANIFEST_UPDATED,c,o),p.off(i["default"].SERVICE_LOCATION_BLACKLIST_CHANGED,d,o),p.off(k["default"].METRIC_ADDED,h,o),p.off(k["default"].METRIC_UPDATED,h,o),p.off(k["default"].PLAYBACK_ERROR,j,o),p.off(m["default"].BECAME_REPORTING_PLAYER,e,o)}var o=void 0,p=a.eventBus,q=a.metricsModel,r=void 0;return o={initialise:l,reset:n},l(),o}Object.defineProperty(c,"__esModule",{value:!0});var f=a("../vo/DVBErrors.js"),g=d(f),h=a("../../../core/events/Events.js"),i=d(h),j=a("../../MediaPlayerEvents.js"),k=d(j),l=a("../MetricsReportingEvents.js"),m=d(l),n=a("../../../core/FactoryMaker.js"),o=d(n);e.__dashjs_factory_name="DVBErrorsTranslator",c["default"]=o["default"].getSingletonFactory(e),b.exports=c["default"]},{"../../../core/FactoryMaker.js":9,"../../../core/events/Events.js":11,"../../MediaPlayerEvents.js":40,"../MetricsReportingEvents.js":65,"../vo/DVBErrors.js":83}],79:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(){return{reconstructFullMetricName:function(a,b,c){var d=a;return b&&(d+="("+b,c&&c.length&&(d+=","+c),d+=")"),d},validateN:function(a){if(!a)throw"missing n";if(isNaN(a))throw"n is NaN";if(0>a)throw"n must be positive";return a}}}Object.defineProperty(c,"__esModule",{value:!0});var f=a("../../../core/FactoryMaker.js"),g=d(f);e.__dashjs_factory_name="HandlerHelpers",c["default"]=g["default"].getSingletonFactory(e),b.exports=c["default"]},{"../../../core/FactoryMaker.js":9}],80:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a){function b(a,b,c){var d,f,g=e.getMpd(a),h=0;return b?h=g.availabilityStartTime.getTime()/1e3:(d=this.getRegularPeriods(a,g),d.length&&(h=d[0].start)),f=h,c&&c.hasOwnProperty("starttime")&&(f+=c.starttime),f}function c(a){var c=[];return a.Metrics_asArray&&a.Metrics_asArray.forEach(function(d){var f=new g["default"],h=e.getIsDynamic(a);d.hasOwnProperty("metrics")&&(f.metrics=d.metrics,d.Range_asArray&&d.Range_asArray.forEach(function(c){var d=new i["default"];d.starttime=b(a,h,c),c.hasOwnProperty("duration")?d.duration=c.duration:d.duration=e.getDuration(a),d._useWallClockTime=h,f.Range.push(d)}),d.Reporting_asArray&&(d.Reporting_asArray.forEach(function(a){var b=new k["default"];if(a.hasOwnProperty("schemeIdUri")){b.schemeIdUri=a.schemeIdUri;for(var c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);f.Reporting.push(b)}}),c.push(f)))}),c}var d=void 0,e=a.dashManifestModel;return d={getMetrics:c}}Object.defineProperty(c,"__esModule",{value:!0});var f=a("../vo/Metrics.js"),g=d(f),h=a("../vo/Range.js"),i=d(h),j=a("../vo/Reporting.js"),k=d(j),l=a("../../../core/FactoryMaker.js"),m=d(l);e.__dashjs_factory_name="ManifestParsing",c["default"]=m["default"].getSingletonFactory(e),b.exports=c["default"]},{"../../../core/FactoryMaker.js":9,"../vo/Metrics.js":84,"../vo/Range.js":85,"../vo/Reporting.js":86}],81:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(){function a(b){var c,d,e=[],f=[];for(c in b)if(b.hasOwnProperty(c)&&0!==c.indexOf("_")){if(d=b[c],(void 0===d||null===d)&&(d=""),Array.isArray(d)){if(!d.length)continue;f=[],d.forEach(function(b){var c="Object"!==Object.prototype.toString.call(b).slice(8,-1);f.push(c?b:a(b))}),d=encodeURIComponent(f.join(","))}else"string"==typeof d?d=encodeURIComponent(d):d instanceof Date?d=d.toISOString():"number"==typeof d&&(d=Math.round(d));e.push(c+"="+d)}return e.join("&")}return{serialise:a}}Object.defineProperty(c,"__esModule",{value:!0});var f=a("../../../core/FactoryMaker.js"),g=d(f);e.__dashjs_factory_name="MetricSerialiser",c["default"]=g["default"].getSingletonFactory(e),b.exports=c["default"]},{"../../../core/FactoryMaker.js":9}],82:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(){function a(){c&&(g||(g=new d(f)),c.getRandomValues(g),h=0)}function b(b,d){var f;return b||(b=0),d||(d=1),c?(h===g.length&&a(),f=g[h]/e,h+=1):f=Math.random(),f*(d-b)+b}var c=window.crypto||window.msCrypto,d=Uint32Array,e=Math.pow(2,8*d.BYTES_PER_ELEMENT)-1,f=10,g=void 0,h=void 0,i=void 0;return i={random:b},a(),i}Object.defineProperty(c,"__esModule",{value:!0});var f=a("../../../core/FactoryMaker.js"),g=d(f);e.__dashjs_factory_name="RNG",c["default"]=g["default"].getSingletonFactory(e),b.exports=c["default"]},{"../../../core/FactoryMaker.js":9}],83:[function(a,b,c){"use strict";function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(c,"__esModule",{value:!0});var e=function f(){d(this,f),this.mpdurl=null,this.errorcode=null,this.terror=null,this.url=null,this.ipaddress=null,this.servicelocation=null};e.SSL_CONNECTION_FAILED_PREFIX="SSL",e.DNS_RESOLUTION_FAILED="C00",e.HOST_UNREACHABLE="C01",e.CONNECTION_REFUSED="C02",e.CONNECTION_ERROR="C03",e.CORRUPT_MEDIA_ISOBMFF="M00",e.CORRUPT_MEDIA_OTHER="M01",e.BASE_URL_CHANGED="F00",e.BECAME_REPORTER="S00",c["default"]=e,b.exports=c["default"]},{}],84:[function(a,b,c){"use strict";function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(c,"__esModule",{value:!0});var e=function f(){d(this,f),this.metrics="",this.Range=[],this.Reporting=[]};c["default"]=e,b.exports=c["default"]},{}],85:[function(a,b,c){"use strict";function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(c,"__esModule",{value:!0});var e=function f(){d(this,f),this.starttime=0,this.duration=1/0,this._useWallClockTime=!1};c["default"]=e,b.exports=c["default"]},{}],86:[function(a,b,c){"use strict";function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(c,"__esModule",{value:!0});var e=function f(){d(this,f),this.schemeIdUri="",this.value=""};c["default"]=e,b.exports=c["default"]},{}],87:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function f(){function a(){l=new n}function b(a,b,c){var d=p.getBaseURLsFromElement(c);a[b]?q.areSimpleEquivalent(d,a[b].data.baseUrls)||(a[b].data.baseUrls=d,a[b].data.selectedIdx=m):a[b]=new n(d)}function c(a){var c=p.getBaseURLsFromElement(a);q.areSimpleEquivalent(c,l.data.baseUrls)||(l.data.baseUrls=c,l.data.selectedIdx=m),a.Period_asArray&&a.Period_asArray.forEach(function(a,c){b(l.children,c,a),a.AdaptationSet_asArray&&a.AdaptationSet_asArray.forEach(function(a,d){b(l.children[c].children,d,a),a.Representation_asArray&&a.Representation_asArray.sort(p.getRepresentationSortFunction()).forEach(function(a,e){b(l.children[c].children[d].children,e,a)})})})}function d(a,b){var c=b||l;a(c.data),c.children&&c.children.forEach(function(b){return d(a,b)})}function e(a){d(function(b){isNaN(b.selectedIdx)||a===b.baseUrls[b.selectedIdx].serviceLocation&&(b.selectedIdx=m)})}function f(a){c(a)}function g(){l=new n}function i(a){var b=l,c=[b.data];return a.forEach(function(a){b=b.children[a],b&&c.push(b.data)}),c.filter(function(a){return a.baseUrls.length})}var k=void 0,l=void 0,o=this.context,p=(0,h["default"])(o).getInstance(),q=(0,j["default"])(o).getInstance();return k={reset:g,update:f,getForPath:i,invalidateSelectedIndexes:e},a(),k}Object.defineProperty(c,"__esModule",{value:!0});var g=a("../../dash/models/DashManifestModel.js"),h=d(g),i=a("../utils/ObjectUtils.js"),j=d(i),k=a("../../core/FactoryMaker.js"),l=d(k),m=NaN,n=function o(a,b){e(this,o),this.data={baseUrls:a||null,selectedIdx:b||m},this.children=[]};f.__dashjs_factory_name="BaseURLTreeModel",c["default"]=l["default"].getClassFactory(f),b.exports=c["default"]},{"../../core/FactoryMaker.js":9,"../../dash/models/DashManifestModel.js":19,"../utils/ObjectUtils.js":142}],88:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a){function b(){E=null,H=null,F=[],G=[],B.on(i["default"].LOADING_COMPLETED,y,D)}function c(a){H=a}function d(a){E=a}function e(){return E}function f(a){var b=function(a,b){return a.action===m["default"].ACTION_COMPLETE&&a.action===b.action},c=function(a,b){return!isNaN(a.index)&&a.index===b.index&&a.startTime===b.startTime&&a.adaptationIndex===b.adaptationIndex},d=function(a,b){return isNaN(a.index)&&isNaN(b.index)&&a.quality===b.quality},e=function(e){var f,g,h=!1,i=e.length;for(g=0;i>g;g++)if(f=e[g],c(a,f)||d(a,f)||b(a,f)){h=!0;break}return h};return e(G)||e(F)}function h(a){var b,c=[],d=[],e=1;if(!a||!a.state)return c;a.state instanceof Array?(e=a.state.length,b=a.state):b=[a.state];for(var f=0;e>f;f++)c=w(b[f]),d=d.concat(v(c,a));return d}function j(a){var b,c=F.length-1,d=NaN,e=null;for(b=c;b>=0;b--)e=F[b],d=e.startTime,!isNaN(d)&&a>d&&t(F,e)}function k(){var a=[];for(H.abort();G.length>0;)a.push(G[0]),t(G,G[0]);return G=[],a}function l(a){if(a)switch(a.action){case m["default"].ACTION_COMPLETE:F.push(a),x(a,q),B.trigger(i["default"].STREAM_COMPLETED,{request:a,fragmentModel:this});break;case m["default"].ACTION_DOWNLOAD:x(a,p),G.push(a),r(a);break;default:A("Unknown request action.")}}function n(){B.off(i["default"].LOADING_COMPLETED,y,this),H&&(H.reset(),H=null),z=null,F=[],G=[]}function r(a){B.trigger(i["default"].FRAGMENT_LOADING_STARTED,{sender:D,request:a}),H.load(a)}function t(a,b){var c=a.indexOf(b);-1!==c&&a.splice(c,1)}function u(a,b,c){var d,e=a.length-1,f=NaN,g=NaN,h=null;for(d=e;d>=0;d--)if(h=a[d],f=h.startTime,g=f+h.duration,c=c||h.duration/2,!isNaN(f)&&!isNaN(g)&&b+c>=f&&g>b-c||isNaN(f)&&isNaN(b))return h;return null}function v(a,b){return b?b.hasOwnProperty("time")?[u(a,b.time,b.threshold)]:a.filter(function(a){for(var c in b)if("state"!==c&&b.hasOwnProperty(c)&&a[c]!=b[c])return!1;return!0}):a}function w(a){var b;switch(a){case p:b=G;break;case q:b=F;break;default:b=[]}return b}function x(a,b){if(a){var c=a.mediaType,d=new Date,e=a.type,f=a.startTime,g=a.availabilityStartTime,h=a.duration,i=a.quality,j=a.range;C.addSchedulingInfo(c,d,e,f,g,h,i,j,b),C.addRequestsQueue(c,G,F)}}function y(a){if(a.sender===H){var b=a.request,c=a.response,d=a.error;G.splice(G.indexOf(b),1),c&&!d&&F.push(b),x(b,d?s:q),B.trigger(i["default"].FRAGMENT_LOADING_COMPLETED,{request:b,response:c,error:d,sender:this})}}var z=this.context,A=(0,o["default"])(z).getInstance().log,B=(0,g["default"])(z).getInstance(),C=a.metricsModel,D=void 0,E=void 0,F=void 0,G=void 0,H=void 0;return D={setLoader:c,setScheduleController:d,getScheduleController:e,getRequests:h,isFragmentLoaded:f,removeExecutedRequestsBeforeTime:j,abortRequests:k,executeRequest:l,reset:n},b(),D}Object.defineProperty(c,"__esModule",{value:!0});var f=a("../../core/EventBus.js"),g=d(f),h=a("../../core/events/Events.js"),i=d(h),j=a("../../core/FactoryMaker.js"),k=d(j),l=a("../vo/FragmentRequest.js"),m=d(l),n=a("../../core/Debug.js"),o=d(n),p="loading",q="executed",r="canceled",s="failed";e.__dashjs_factory_name="FragmentModel";var t=k["default"].getClassFactory(e);t.FRAGMENT_MODEL_LOADING=p,t.FRAGMENT_MODEL_EXECUTED=q,t.FRAGMENT_MODEL_CANCELED=r,t.FRAGMENT_MODEL_FAILED=s,c["default"]=t,b.exports=c["default"]},{"../../core/Debug.js":7,"../../core/EventBus.js":8,"../../core/FactoryMaker.js":9,"../../core/events/Events.js":11,"../vo/FragmentRequest.js":150}],89:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(){function a(){return f}function b(a){f=a,d.trigger(i["default"].MANIFEST_LOADED,{data:a})}var c=this.context,d=(0,g["default"])(c).getInstance(),e=void 0,f=void 0;return e={getValue:a,setValue:b}}Object.defineProperty(c,"__esModule",{value:!0});var f=a("../../core/EventBus.js"),g=d(f),h=a("../../core/events/Events.js"),i=d(h),j=a("../../core/FactoryMaker.js"),k=d(j);e.__dashjs_factory_name="ManifestModel",c["default"]=k["default"].getSingletonFactory(e),b.exports=c["default"]},{"../../core/EventBus.js":8,"../../core/FactoryMaker.js":9,"../../core/events/Events.js":11}],90:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a,b,c){return b in a?Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0}):a[b]=c,a}function f(){function a(){var a,b;sa=[],ra=!1,qa=!0,va=!0,Ka=!1,ya={enabled:!0,ttl:m},za={enabled:!0,ttl:n},ta=l,ua=void 0,wa=q,xa=r,Aa=s,Ba=t,Ca=u,Da=v,Ea=w,Fa=o,Ga=p,Ja=D,a={},e(a,j["default"].MPD_TYPE,z),e(a,j["default"].XLINK_EXPANSION_TYPE,B),e(a,j["default"].MEDIA_SEGMENT_TYPE,x),e(a,j["default"].INIT_SEGMENT_TYPE,x),e(a,j["default"].BITSTREAM_SWITCHING_SEGMENT_TYPE,x),e(a,j["default"].INDEX_SEGMENT_TYPE,x),e(a,j["default"].OTHER_TYPE,x),Ha=a,b={},e(b,j["default"].MPD_TYPE,A),e(b,j["default"].XLINK_EXPANSION_TYPE,C),e(b,j["default"].MEDIA_SEGMENT_TYPE,y),e(b,j["default"].INIT_SEGMENT_TYPE,y),e(b,j["default"].BITSTREAM_SWITCHING_SEGMENT_TYPE,y),e(b,j["default"].INDEX_SEGMENT_TYPE,y),e(b,j["default"].OTHER_TYPE,y),Ia=b}function b(a){Ka=a}function c(){return Ka}function d(a){Fa=a}function f(){return Fa}function g(a){Ga=a}function h(){return Ga}function i(a){Aa=a}function k(){return Aa}function E(a){Ba=a}function F(){return Ba}function G(a){Ca=a}function H(){return Ca}function I(a){Da=a}function J(){return Da}function K(a){Ea=a}function L(){return Ea}function M(a){wa=a}function N(){return wa}function O(a,b){ya.enabled=a,void 0===b||isNaN(b)||"number"!=typeof b||(ya.ttl=b)}function P(){return ya}function Q(a,b){za.enabled=a,void 0===b||isNaN(b)||"number"!=typeof b||(za.ttl=b)}function R(){return za}function S(a){xa=a}function T(){return xa}function U(a){Ha[j["default"].MEDIA_SEGMENT_TYPE]=a}function V(a,b){Ha[a]=b}function W(){return Ha[j["default"].MEDIA_SEGMENT_TYPE]}function X(a){return Ha[a]}function Y(a){Ia[j["default"].MEDIA_SEGMENT_TYPE]=a}function Z(a,b){Ia[a]=b}function $(){return Ia[j["default"].MEDIA_SEGMENT_TYPE]}function _(a){return Ia[a]}function aa(a){Ja=a}function ba(){return Ja}function ca(a){va=a}function da(){return va}function ea(a){ta=a}function fa(a){ua=a}function ga(){return ta}function ha(){return ua}function ia(a){qa=a}function ja(){return qa}function ka(a){ra=a}function la(){return ra}function ma(a){sa=a}function na(){return sa}function oa(){}var pa=void 0,qa=void 0,ra=void 0,sa=void 0,ta=void 0,ua=void 0,va=void 0,wa=void 0,xa=void 0,ya=void 0,za=void 0,Aa=void 0,Ba=void 0,Ca=void 0,Da=void 0,Ea=void 0,Fa=void 0,Ga=void 0,Ha=void 0,Ia=void 0,Ja=void 0,Ka=void 0;return pa={setBufferOccupancyABREnabled:b,getBufferOccupancyABREnabled:c,setBandwidthSafetyFactor:d,getBandwidthSafetyFactor:f,setAbandonLoadTimeout:g,getAbandonLoadTimeout:h,setLastBitrateCachingInfo:O,getLastBitrateCachingInfo:P,setLastMediaSettingsCachingInfo:Q,getLastMediaSettingsCachingInfo:R,setStableBufferTime:i,getStableBufferTime:k,setBufferTimeAtTopQuality:E,getBufferTimeAtTopQuality:F,setBufferTimeAtTopQualityLongForm:G,getBufferTimeAtTopQualityLongForm:H,setLongFormContentDurationThreshold:I,getLongFormContentDurationThreshold:J,setRichBufferThreshold:K,getRichBufferThreshold:L,setBufferToKeep:M,getBufferToKeep:N,setBufferPruningInterval:S,getBufferPruningInterval:T,setFragmentRetryAttempts:U,getFragmentRetryAttempts:W,setRetryAttemptsForType:V,getRetryAttemptsForType:X,setFragmentRetryInterval:Y,getFragmentRetryInterval:$,setRetryIntervalForType:Z,getRetryIntervalForType:_,setWallclockTimeUpdateInterval:aa,getWallclockTimeUpdateInterval:ba,setScheduleWhilePaused:ca,getScheduleWhilePaused:da,getUseSuggestedPresentationDelay:la,setUseSuggestedPresentationDelay:ka,setLiveDelayFragmentCount:ea,getLiveDelayFragmentCount:ga,getLiveDelay:ha,setLiveDelay:fa,setUseManifestDateHeaderTimeSource:ia,getUseManifestDateHeaderTimeSource:ja,setUTCTimingSources:ma,getUTCTimingSources:na,reset:oa},a(),pa}Object.defineProperty(c,"__esModule",{value:!0});var g=a("../../core/FactoryMaker.js"),h=d(g),i=a("../vo/metrics/HTTPRequest.js"),j=d(i),k={scheme:"urn:mpeg:dash:utc:http-xsdate:2014",value:"http://time.akamai.com/?iso"},l=4,m=36e4,n=36e4,o=.9,p=1e4,q=30,r=30,s=12,t=30,u=60,v=600,w=20,x=3,y=1e3,z=3,A=500,B=1,C=500,D=50;f.__dashjs_factory_name="MediaPlayerModel";var E=h["default"].getSingletonFactory(f);E.DEFAULT_UTC_TIMING_SOURCE=k,c["default"]=E,b.exports=c["default"]},{"../../core/FactoryMaker.js":9,"../vo/metrics/HTTPRequest.js":166}],91:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(){function a(){T={}}function b(a){a&&a.adapter&&(S=a.adapter)}function c(){Q.trigger(E["default"].METRICS_CHANGED)}function d(a){Q.trigger(E["default"].METRIC_CHANGED,{mediaType:a}),c()}function e(a,b,c){Q.trigger(E["default"].METRIC_UPDATED,{mediaType:a,metric:b,value:c}),d(a)}function f(a,b,c){Q.trigger(E["default"].METRIC_ADDED,{mediaType:a,metric:b,value:c}),d(a)}function h(a){delete T[a],d(a)}function j(){T={},c()}function l(a){return T.hasOwnProperty(a)?T[a]:null}function n(a){var b;return T.hasOwnProperty(a)?b=T[a]:(b=new g["default"],T[a]=b),b}function p(a,b,c,d,e,g){var h=new i["default"];return h.tcpid=b,h.dest=c,h.topen=d,h.tclose=e,h.tconnect=g,n(a).TcpList.push(h),f(a,S.metricsList.TCP_CONNECTION,h),h}function r(a,b,c,d){var e=new k["default"].Trace;return e.s=b,e.d=c,e.b=d,a.trace.push(e),a.interval||(a.interval=0),a.interval+=c,e}function t(a,b,c,d,e,g,h,i,j,l,m,o,p,q){var s=new k["default"];return e&&e!==d&&(t(a,null,c,d,null,null,h,i,null,null,null,o,null,null),s.actualurl=e),s.tcpid=b,s.type=c,s.url=d,s.range=h,s.trequest=i,s.tresponse=j,s.responsecode=m,s._tfinish=l,s._stream=a,s._mediaduration=o,s._responseHeaders=p,s._serviceLocation=g,q?q.forEach(function(a){r(s,a.s,a.d,a.b)}):(delete s.interval,delete s.trace),n(a).HttpList.push(s),f(a,S.metricsList.HTTP_REQUEST,s),s}function v(a,b,c,d,e){var g=new m["default"];return g.t=b,g.mt=c,g.to=d,e?g.lto=e:delete g.lto,n(a).RepSwitchList.push(g),f(a,S.metricsList.TRACK_SWITCH,g),g}function x(a,b,c){var d=new o["default"];return d.t=b,d.level=c,n(a).BufferLevel.push(d),f(a,S.metricsList.BUFFER_LEVEL,d),d}function z(a,b,c){var d=new q["default"];return d.target=c,d.state=b,n(a).BufferState.push(d),f(a,S.metricsList.BUFFER_STATE,d),d}function B(a,b,c,d){var e=new s["default"];return e.time=b,e.range=d,e.manifestInfo=c,n(a).DVRInfo.push(e),f(a,S.metricsList.DVR_INFO,e),e}function D(a,b){var c=new u["default"],d=n(a).DroppedFrames;return c.time=b.creationTime,c.droppedFrames=b.droppedVideoFrames,d.length>0&&d[d.length-1]==c?d[d.length-1]:(d.push(c),f(a,S.metricsList.DROPPED_FRAMES,c),c)}function F(a,b,c,d,e,g,h,i,j){var k=new y["default"];return k.mediaType=a,k.t=b,k.type=c,k.startTime=d,k.availabilityStartTime=e,k.duration=g,k.quality=h,k.range=i,k.state=j,n(a).SchedulingInfo.push(k),f(a,S.metricsList.SCHEDULING_INFO,k),k}function G(a,b,c){var d=new C["default"];d.loadingRequests=b,d.executedRequests=c,n(a).RequestsQueue=d,f(a,S.metricsList.REQUESTS_QUEUE,d)}function H(a,b,c,d,e,g,h,i,j,k){var l=new w["default"],m=n("stream");return l.mediaType=a,l.type=b,l.requestTime=c,l.fetchTime=d,l.availabilityStartTime=e,l.presentationStartTime=g,l.clientTimeOffset=h,l.currentTime=i,l.buffered=j,l.latency=k,m.ManifestUpdate.push(l),f(a,S.metricsList.MANIFEST_UPDATE,l),l}function J(a,b){if(a){for(var c in b)a[c]=b[c];e(a.mediaType,S.metricsList.MANIFEST_UPDATE,a)}}function K(a,b,c,d,f){if(a){var g=new w["default"].StreamInfo;return g.id=b,g.index=c,g.start=d,g.duration=f,a.streamInfo.push(g),e(a.mediaType,S.metricsList.MANIFEST_UPDATE_STREAM_INFO,a),g}return null}function L(a,b,c,d,f,g,h,i){if(a){var j=new w["default"].TrackInfo;return j.id=b,j.index=c,j.streamIndex=d,j.mediaType=f,j.startNumber=h,j.fragmentInfoType=i,j.presentationTimeOffset=g,a.trackInfo.push(j),e(a.mediaType,S.metricsList.MANIFEST_UPDATE_TRACK_INFO,a),j}return null}function M(a){var b="stream";return a.trace&&Array.isArray(a.trace)?a.trace.forEach(function(a){a.hasOwnProperty("subreplevel")&&!a.subreplevel&&delete a.subreplevel}):delete a.trace,n(b).PlayList.push(a),f(b,S.metricsList.PLAY_LIST,a),a}function N(a){var b="stream";return n(b).DVBErrors.push(a),f(b,S.metricsList.DVB_ERRORS,a),a}function O(a,b){var c=new I["default"];return c._s=b,n(a).BolaState=[c],f(a,"BolaState",c),c}var P=this.context,Q=(0,A["default"])(P).getInstance(),R=void 0,S=void 0,T=void 0;return R={metricsChanged:c,metricChanged:d,metricUpdated:e,metricAdded:f,clearCurrentMetricsForType:h,clearAllCurrentMetrics:j,getReadOnlyMetricsFor:l,getMetricsFor:n,addTcpConnection:p,addHttpRequest:t,addRepresentationSwitch:v,addBufferLevel:x,addBufferState:z,addDVRInfo:B,addDroppedFrames:D,addSchedulingInfo:F,addRequestsQueue:G,addManifestUpdate:H,updateManifestUpdateInfo:J,addManifestUpdateStreamInfo:K,addManifestUpdateRepresentationInfo:L,addPlayList:M,addDVBErrors:N,updateBolaState:O,setConfig:b},a(),R}Object.defineProperty(c,"__esModule",{value:!0});var f=a("../vo/MetricsList.js"),g=d(f),h=a("../vo/metrics/TCPConnection.js"),i=d(h),j=a("../vo/metrics/HTTPRequest.js"),k=d(j),l=a("../vo/metrics/RepresentationSwitch.js"),m=d(l),n=a("../vo/metrics/BufferLevel.js"),o=d(n),p=a("../vo/metrics/BufferState.js"),q=d(p),r=a("../vo/metrics/DVRInfo.js"),s=d(r),t=a("../vo/metrics/DroppedFrames.js"),u=d(t),v=a("../vo/metrics/ManifestUpdate.js"),w=d(v),x=a("../vo/metrics/SchedulingInfo.js"),y=d(x),z=a("../../core/EventBus.js"),A=d(z),B=a("../vo/metrics/RequestsQueue.js"),C=d(B),D=a("../../core/events/Events.js"),E=d(D),F=a("../../core/FactoryMaker.js"),G=d(F),H=a("../vo/metrics/BolaState.js"),I=d(H);e.__dashjs_factory_name="MetricsModel",c["default"]=G["default"].getSingletonFactory(e),b.exports=c["default"]},{"../../core/EventBus.js":8,"../../core/FactoryMaker.js":9,"../../core/events/Events.js":11,"../vo/MetricsList.js":155,"../vo/metrics/BolaState.js":161,"../vo/metrics/BufferLevel.js":162,"../vo/metrics/BufferState.js":163,"../vo/metrics/DVRInfo.js":164,"../vo/metrics/DroppedFrames.js":165,"../vo/metrics/HTTPRequest.js":166,"../vo/metrics/ManifestUpdate.js":167,"../vo/metrics/RepresentationSwitch.js":169,"../vo/metrics/RequestsQueue.js":170,"../vo/metrics/SchedulingInfo.js":171,"../vo/metrics/TCPConnection.js":172}],92:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(){function a(){h=new g["default"],i=[],j=!1}function b(){return h}function c(){return i}function d(){return j}function e(a){function b(a,b,c,d){var e=d[0].split(/[=]/);return d.push({key:e[0],value:e[1]}),d.shift(),d}function c(a,b,c){return b>0&&(l&&0===i.length?i=c[b].split(/[&]/):m&&(e=c[b].split(/[&]/))),c}if(!a)return null;var d,e=[],f=new RegExp(/[?]/),g=new RegExp(/[#]/),k=new RegExp(/^(https:)?\/\//i),l=f.test(a),m=g.test(a);return j=k.test(a),d=a.split(/[?#]/).map(c),i.length>0&&(i=i.reduce(b,null)),e.length>0&&(e=e.reduce(b,null),e.forEach(function(a){h[a.key]=a.value})),a}var f=void 0,h=void 0,i=void 0,j=void 0;return f={initialize:a,parseURI:e,getURIFragmentData:b,getURIQueryData:c,isManifestHTTPS:d}}Object.defineProperty(c,"__esModule",{value:!0});var f=a("../vo/URIFragmentData.js"),g=d(f),h=a("../../core/FactoryMaker.js"),i=d(h);e.__dashjs_factory_name="URIQueryAndFragmentModel",c["default"]=i["default"].getSingletonFactory(e),b.exports=c["default"]},{"../../core/FactoryMaker.js":9,"../vo/URIFragmentData.js":160}],93:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(){function a(){v=[]}function b(a){!s||s.readyState<2||(s.playbackRate=a)}function c(a){if(s.currentTime!=a)try{s.currentTime=a}catch(b){0===s.readyState&&b.code===b.INVALID_STATE_ERR&&setTimeout(function(){s.currentTime=a},400)}}function d(){return s}function e(a){s=a,s.preload="auto"}function f(a){a?s.src=a:(s.removeAttribute("src"),s.load())}function g(){return s.src}function h(){return u}function i(a){u=a}function j(){return t}function k(a){t=a,t.style.position="absolute",t.style.display="flex",t.style.overflow="hidden",t.style.pointerEvents="none",t.style.top=0,t.style.left=0}function l(a,b){p(a,b)}function m(){return v.length>0}function n(a){var c=void 0;null===a||s.seeking||-1!==v.indexOf(a)||(v.push(a),1===v.length&&(c=document.createEvent("Event"),c.initEvent("waiting",!0,!1),w=s.playbackRate,b(0),s.dispatchEvent(c)))}function o(a){var c=v.indexOf(a),d=void 0;null!==a&&(-1!==c&&v.splice(c,1),m()===!1&&0===s.playbackRate&&(d=document.createEvent("Event"),d.initEvent("playing",!0,!1),b(w||1),s.dispatchEvent(d)))}function p(a,b){b?n(a):o(a)}function q(){var a="webkitDroppedFrameCount"in s,b="getVideoPlaybackQuality"in s,c=null;return b?c=s.getVideoPlaybackQuality():a&&(c={droppedVideoFrames:s.webkitDroppedFrameCount,creationTime:new Date}),c}var r=void 0,s=void 0,t=void 0,u=void 0,v=void 0,w=void 0;return r={initialize:a,setCurrentTime:c,setStallState:l,getElement:d,setElement:e,setSource:f,getSource:g,getVideoContainer:h,setVideoContainer:i,getTTMLRenderingDiv:j,setTTMLRenderingDiv:k,getPlaybackQuality:q}}Object.defineProperty(c,"__esModule",{value:!0});var f=a("../../core/FactoryMaker.js"),g=d(f);e.__dashjs_factory_name="VideoModel",c["default"]=g["default"].getSingletonFactory(e),b.exports=c["default"]},{"../../core/FactoryMaker.js":9}],94:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(c,"__esModule",{value:!0});var f=function(){function a(a,b){for(var c=0;c0&&(b+=4+16*c.getUint32(b)),b+=4,a.slice(b)}},{key:"getPSSHForKeySystem",value:function(b,c){var d=a.parsePSSHList(c);return d.hasOwnProperty(b.uuid.toLowerCase())?d[b.uuid.toLowerCase()]:null}},{key:"parseInitDataFromContentProtection",value:function(a){return"pssh"in a?h["default"].decodeArray(a.pssh.__text).buffer:null}},{key:"parsePSSHList",value:function(a){if(null===a)return[];for(var b=new DataView(a),c=!1,d={},e=0;!c;){var f,g,h,i,j,k=e;if(e>=b.buffer.byteLength)break;if(f=b.getUint32(e),g=e+f,e+=4,1886614376===b.getUint32(e))if(e+=4,h=b.getUint8(e),0===h||1===h){e++,e+=3,i="";var l,m;for(l=0;4>l;l++)m=b.getUint8(e+l).toString(16),i+=1===m.length?"0"+m:m;for(e+=4,i+="-",l=0;2>l;l++)m=b.getUint8(e+l).toString(16),i+=1===m.length?"0"+m:m;for(e+=2,i+="-",l=0;2>l;l++)m=b.getUint8(e+l).toString(16), +i+=1===m.length?"0"+m:m;for(e+=2,i+="-",l=0;2>l;l++)m=b.getUint8(e+l).toString(16),i+=1===m.length?"0"+m:m;for(e+=2,i+="-",l=0;6>l;l++)m=b.getUint8(e+l).toString(16),i+=1===m.length?"0"+m:m;e+=6,i=i.toLowerCase(),j=b.getUint32(e),e+=4,d[i]=b.buffer.slice(k,g),e=g}else e=g;else e=g}return d}}]),a}();c["default"]=i,b.exports=c["default"]},{"../../../externals/base64.js":1}],95:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(){function a(a){var c=null,d=(0,i["default"])(e).getInstance();d.setConfig({log:a.log}),d.initialize();var f=b(a);return!c&&f&&(c=(0,g["default"])(e).create({protectionModel:f,protectionKeyController:d,adapter:a.adapter,eventBus:a.eventBus,log:a.log}),a.capabilities.setEncryptedMediaSupported(!0)),c}function b(a){var b=a.log,d=a.eventBus,f=a.videoModel.getElement();return void 0!==f.onencrypted&&void 0!==f.mediaKeys&&void 0!==navigator.requestMediaKeySystemAccess&&"function"==typeof navigator.requestMediaKeySystemAccess?(b("EME detected on this user agent! (ProtectionModel_21Jan2015)"),(0,m["default"])(e).create({log:b,eventBus:d})):c(f,u)?(b("EME detected on this user agent! (ProtectionModel_3Feb2014)"),(0,o["default"])(e).create({log:b,eventBus:d,api:c(f,u)})):c(f,t)?(b("EME detected on this user agent! (ProtectionModel_01b)"),(0,q["default"])(e).create({log:b,eventBus:d,api:c(f,t)})):(b("No supported version of EME detected on this user agent! - Attempts to play encrypted content will fail!"),null)}function c(a,b){for(var c=0;c0&&s(f,!0),H=!0}}function d(a){var b=g["default"].getPSSHForKeySystem(J,a);if(b){for(var c=x.getAllInitData(),d=0;df;f++){var g=b.getUint16(d,!0);d+=2;var h=b.getUint16(d,!0);if(d+=2,1===g){var i=a.slice(d,d+h),j=String.fromCharCode.apply(null,new Uint16Array(i)),k=e.parseFromString(j,"application/xml");if(k.getElementsByTagName("LA_URL")[0]){var l=k.getElementsByTagName("LA_URL")[0].childNodes[0].nodeValue;if(l)return l}if(k.getElementsByTagName("LUI_URL")[0]){var m=k.getElementsByTagName("LUI_URL")[0].childNodes[0].nodeValue;if(m)return m}}else d+=h}return null}function d(a){var b,c,d,e,f,h=new Uint8Array([112,115,115,104,0,0,0,0]),i=new Uint8Array([154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149]),j=0,k=null;if("pssh"in a)return g["default"].parseInitDataFromContentProtection(a);if("pro"in a)k=m["default"].decodeArray(a.pro.__text);else{if(!("prheader"in a))return null;k=m["default"].decodeArray(a.prheader.__text)}return b=k.length,c=4+h.length+i.length+4+b,d=new ArrayBuffer(c),e=new Uint8Array(d),f=new DataView(d),f.setUint32(j,c),j+=4,e.set(h,j),j+=h.length,e.set(i,j),j+=i.length,f.setUint32(j,b),j+=4,e.set(k,j),j+=b,e.buffer}function e(a){if("utf8"!==a&&"utf16"!==a)throw new i["default"]("Illegal PlayReady message format! -- "+a);h=a}var f=void 0,h="utf16";return f={uuid:n,schemeIdURI:p,systemString:o,getInitData:d,getRequestHeadersFromMessage:a,getLicenseRequestFromMessage:b,getLicenseServerURLFromInitData:c,setPlayReadyMessageFormat:e}}Object.defineProperty(c,"__esModule",{value:!0});var f=a("../CommonEncryption.js"),g=d(f),h=a("../../vo/Error.js"),i=d(h),j=a("../../../core/FactoryMaker.js"),k=d(j),l=a("../../../../externals/base64.js"),m=d(l),n="9a04f079-9840-4286-ab92-e65be0885f95",o="com.microsoft.playready",p="urn:uuid:"+n;e.__dashjs_factory_name="KeySystemPlayReady",c["default"]=k["default"].getSingletonFactory(e),b.exports=c["default"]},{"../../../../externals/base64.js":1,"../../../core/FactoryMaker.js":9,"../../vo/Error.js":149,"../CommonEncryption.js":94}],101:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(){function a(a){return g["default"].parseInitDataFromContentProtection(a)}function b(){return null}function c(a){return new Uint8Array(a)}function d(){return null}var e=void 0;return e={uuid:j,schemeIdURI:l,systemString:k,getInitData:a,getRequestHeadersFromMessage:b,getLicenseRequestFromMessage:c,getLicenseServerURLFromInitData:d}}Object.defineProperty(c,"__esModule",{value:!0});var f=a("../CommonEncryption.js"),g=d(f),h=a("../../../core/FactoryMaker.js"),i=d(h),j="edef8ba9-79d6-4ace-a3c8-27dcd51d21ed",k="com.widevine.alpha",l="urn:uuid:"+j;e.__dashjs_factory_name="KeySystemWidevine",c["default"]=i["default"].getSingletonFactory(e),b.exports=c["default"]},{"../../../core/FactoryMaker.js":9,"../CommonEncryption.js":94}],102:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a){function b(){E=null,F=null,I=[],J=[],G=(0,g["default"])(z).getInstance(),H=(0,u["default"])(z).getInstance(),L=w()}function c(){E&&y();for(var a=0;a0&&(b=I.shift(),J.push(b),b.sessionID=a.sessionId)):I.length>0&&(b=I.shift(),J.push(b),0!==I.length&&H.mediaKeyMessageError("Multiple key sessions were creates with a user-agent that does not support sessionIDs!! Unpredictable behavior ahead!")),b){var e=ArrayBuffer.isView(a.message)?a.message.buffer:a.message;b.keyMessage=e,A.trigger(s["default"].INTERNAL_KEY_MESSAGE,{data:new m["default"](b,e,a.defaultURL)})}else B("No session token found for key message")}}}}function x(a,b){if(b&&a){for(var c=a.length,d=0;c>d;d++)if(a[d].sessionID==b)return a[d];return null}return null}function y(){E.removeEventListener(C.keyerror,L),E.removeEventListener(C.needkey,L),E.removeEventListener(C.keymessage,L),E.removeEventListener(C.keyadded,L)}var z=this.context,A=a.eventBus,B=a.log,C=a.api,D=void 0,E=void 0,F=void 0,G=void 0,H=void 0,I=void 0,J=void 0,K=void 0,L=void 0;return D={getAllInitData:e,requestKeySystemAccess:f,getKeySystem:d,selectKeySystem:h,setMediaElement:j,createKeySession:l,updateKeySession:n,closeKeySession:p,setServerCertificate:r,loadKeySession:t,removeKeySession:v,reset:c},b(),D}Object.defineProperty(c,"__esModule",{value:!0});var f=a("../controllers/ProtectionKeyController.js"),g=d(f),h=a("../vo/NeedKey.js"),i=d(h),j=a("../vo/KeyError.js"),k=d(j),l=a("../vo/KeyMessage.js"),m=d(l),n=a("../vo/KeySystemConfiguration.js"),o=d(n),p=a("../vo/KeySystemAccess.js"),q=d(p),r=a("../../../core/events/Events.js"),s=d(r),t=a("../../utils/ErrorHandler.js"),u=d(t),v=a("../../../core/FactoryMaker.js"),w=d(v);e.__dashjs_factory_name="ProtectionModel_01b",c["default"]=w["default"].getClassFactory(e),b.exports=c["default"]},{"../../../core/FactoryMaker.js":9,"../../../core/events/Events.js":11,"../../utils/ErrorHandler.js":139,"../controllers/ProtectionKeyController.js":98,"../vo/KeyError.js":110,"../vo/KeyMessage.js":111,"../vo/KeySystemAccess.js":113,"../vo/KeySystemConfiguration.js":114,"../vo/NeedKey.js":116}],103:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a){function b(){A=null,B=null,C=null,D=[],F=(0,g["default"])(G).getInstance(),E=w()}function c(){var a,b=D.length;if(0!==b)for(var c=function(a){x(a),0===D.length&&(B?(B.removeEventListener("encrypted",E),B.setMediaKeys(null).then(function(){H.trigger(q["default"].TEARDOWN_COMPLETE)})):H.trigger(q["default"].TEARDOWN_COMPLETE))},d=0;b>d;d++)a=D[d],function(b){a.session.closed.then(function(){c(b)}),v(a)["catch"](function(){c(b)})}(a);else H.trigger(q["default"].TEARDOWN_COMPLETE)}function d(){return A}function e(){for(var a=[],b=0;b0&&(b=G.ksConfiguration.videoCapabilities[0]),null===b&&null!==G.ksConfiguration.audioCapabilities&&G.ksConfiguration.audioCapabilities.length>0&&(b=G.ksConfiguration.audioCapabilities[0]),null===b)throw new Error("Can not create sessions for unknown content types.");var c=b.contentType,d=F.createSession(c,new Uint8Array(a)),e=x(d,a);d.addEventListener(B.error,e),d.addEventListener(B.message,e),d.addEventListener(B.ready,e),d.addEventListener(B.close,e),H.push(e),A("DRM: Session created. SessionID = "+e.getSessionID()),z.trigger(s["default"].KEY_SESSION_CREATED,{data:e})}function n(a,b){var c=a.session;J.isClearKey(E)?c.update(new Uint8Array(b.toJWK())):c.update(new Uint8Array(b))}function p(a){var b=a.session;b.removeEventListener(B.error,a),b.removeEventListener(B.message,a),b.removeEventListener(B.ready,a),b.removeEventListener(B.close,a);for(var c=0;c=1?b():(a=b.bind(this),D.addEventListener("loadedmetadata",a))}function x(a,b){return{session:a,initData:b,getSessionID:function(){return this.session.sessionId},getExpirationTime:function(){return NaN},getSessionType:function(){return"temporary"},handleEvent:function(a){switch(a.type){case B.error:var b="KeyError";z.trigger(s["default"].KEY_ERROR,{data:new k["default"](this,b)});break;case B.message:var c=ArrayBuffer.isView(a.message)?a.message.buffer:a.message;z.trigger(s["default"].INTERNAL_KEY_MESSAGE,{data:new m["default"](this,c,a.destinationURL)});break;case B.ready:A("DRM: Key added."),z.trigger(s["default"].KEY_ADDED);break;case B.close:A("DRM: Session closed. SessionID = "+this.getSessionID()),z.trigger(s["default"].KEY_SESSION_CLOSED,{data:this.getSessionID()})}}}}var y=this.context,z=a.eventBus,A=a.log,B=a.api,C=void 0,D=void 0,E=void 0,F=void 0,G=void 0,H=void 0,I=void 0,J=void 0;return C={getAllInitData:e,requestKeySystemAccess:f,getKeySystem:d,selectKeySystem:h,setMediaElement:j,createKeySession:l,updateKeySession:n,closeKeySession:p,setServerCertificate:r,loadKeySession:t,removeKeySession:u,reset:c},b(),C}Object.defineProperty(c,"__esModule",{value:!0});var f=a("../controllers/ProtectionKeyController.js"),g=d(f),h=a("../vo/NeedKey.js"),i=d(h),j=a("../vo/KeyError.js"),k=d(j),l=a("../vo/KeyMessage.js"),m=d(l),n=a("../vo/KeySystemConfiguration.js"),o=d(n),p=a("../vo/KeySystemAccess.js"),q=d(p),r=a("../../../core/events/Events.js"),s=d(r),t=a("../../../core/FactoryMaker.js"),u=d(t);e.__dashjs_factory_name="ProtectionModel_3Feb2014",c["default"]=u["default"].getClassFactory(e),b.exports=c["default"]},{"../../../core/FactoryMaker.js":9,"../../../core/events/Events.js":11,"../controllers/ProtectionKeyController.js":98,"../vo/KeyError.js":110,"../vo/KeyMessage.js":111,"../vo/KeySystemAccess.js":113,"../vo/KeySystemConfiguration.js":114,"../vo/NeedKey.js":116}],105:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(){function a(a,b){var c=JSON.parse(String.fromCharCode.apply(null,new Uint8Array(b)));a+="/?";for(var d=0;da;a++){var d={kty:"oct",alg:"A128KW",kid:this.keyPairs[a].keyID,k:this.keyPairs[a].key};c.keys.push(d)}this.type&&(c.type=this.type);var e=JSON.stringify(c),f=e.length,g=new ArrayBuffer(f),h=new Uint8Array(g);for(a=0;f>a;a++)h[a]=e.charCodeAt(a);return g}}]),a}();c["default"]=f,b.exports=c["default"]},{}],110:[function(a,b,c){"use strict";function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(c,"__esModule",{value:!0});var e=function f(a,b){d(this,f),this.sessionToken=a,this.error=b};c["default"]=e,b.exports=c["default"]},{}],111:[function(a,b,c){"use strict";function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(c,"__esModule",{value:!0});var e=function f(a,b,c,e){d(this,f),this.sessionToken=a,this.message=b,this.defaultURL=c,this.messageType=e?e:"license-request"};c["default"]=e,b.exports=c["default"]},{}],112:[function(a,b,c){"use strict";function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(c,"__esModule",{value:!0});var e=function f(a,b){d(this,f),this.keyID=a,this.key=b};c["default"]=e,b.exports=c["default"]},{}],113:[function(a,b,c){"use strict";function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(c,"__esModule",{value:!0});var e=function f(a,b){d(this,f),this.keySystem=a,this.ksConfiguration=b};c["default"]=e,b.exports=c["default"]},{}],114:[function(a,b,c){"use strict";function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(c,"__esModule",{value:!0});var e=function f(a,b,c,e,g){d(this,f),this.initDataTypes=["cenc"],this.audioCapabilities=a,this.videoCapabilities=b,this.distinctiveIdentifier=c,this.persistentState=e,this.sessionTypes=g};c["default"]=e,b.exports=c["default"]},{}],115:[function(a,b,c){"use strict";function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(c,"__esModule",{value:!0});var e=function f(a,b){d(this,f),this.contentType=a,this.robustness=b};c["default"]=e,b.exports=c["default"]},{}],116:[function(a,b,c){"use strict";function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(c,"__esModule",{value:!0});var e=function f(a,b){d(this,f),this.initData=a,this.initDataType=b};c["default"]=e,b.exports=c["default"]},{}],117:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a){function b(){return i.mediaInfo.streamInfo}function c(){return i.mediaInfo}function d(){return i}function e(){return k}function f(){return i.mediaInfo.streamInfo.manifestInfo}function g(){return j}var h=void 0,i=a.streamProcessor.getCurrentRepresentationInfo(),j=a.streamProcessor,k=a.currentValue;return h={getStreamInfo:b,getMediaInfo:c,getTrackInfo:d,getCurrentValue:e,getManifestInfo:f,getStreamProcessor:g}}Object.defineProperty(c,"__esModule",{value:!0});var f=a("../../core/FactoryMaker.js"),g=d(f);e.__dashjs_factory_name="RulesContext",c["default"]=g["default"].getClassFactory(e),b.exports=c["default"]},{"../../core/FactoryMaker.js":9}],118:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(){function a(){j={}}function b(a){a&&(a.abrRulesCollection&&(j[p]=a.abrRulesCollection),a.synchronizationRulesCollection&&(j[q]=a.synchronizationRulesCollection))}function c(a,b,c,d,f){var g,h,j={},k=a.length,l=k,m=e(b,d),n=function(a){var b,e;a.value!==i["default"].NO_CHANGE&&(j[a.priority]=f(j[a.priority],a.value)),--k||(j[i["default"].WEAK]!==i["default"].NO_CHANGE&&(e=i["default"].WEAK,b=j[i["default"].WEAK]),j[i["default"].DEFAULT]!==i["default"].NO_CHANGE&&(e=i["default"].DEFAULT,b=j[i["default"].DEFAULT]),j[i["default"].STRONG]!==i["default"].NO_CHANGE&&(e=i["default"].STRONG,b=j[i["default"].STRONG]),e!=i["default"].STRONG&&e!=i["default"].WEAK&&(e=i["default"].DEFAULT),c({value:void 0!==b?b:d,confidence:e}))};for(j[i["default"].STRONG]=i["default"].NO_CHANGE,j[i["default"].WEAK]=i["default"].NO_CHANGE,j[i["default"].DEFAULT]=i["default"].NO_CHANGE,h=0;l>h;h++)g=a[h],g.execute(m,n)}function d(){var a,b,c=j[p],d=j[q],e=(c.getRules(k["default"].QUALITY_SWITCH_RULES)||[]).concat(c.getRules(k["default"].ABANDON_FRAGMENT_RULES)||[]).concat(d.getRules(m["default"].TIME_SYNCHRONIZED_RULES)||[]).concat(d.getRules(m["default"].BEST_GUESS_RULES)||[]),f=e.length;for(b=0;f>b;b++)a=e[b],"function"==typeof a.reset&&a.reset();j={}}function e(a,b){return(0,g["default"])(f).create({streamProcessor:a,currentValue:b})}var f=this.context,h=void 0,j=void 0;return h={initialize:a,setConfig:b,applyRules:c,reset:d}}Object.defineProperty(c,"__esModule",{value:!0});var f=a("./RulesContext.js"),g=d(f),h=a("./SwitchRequest.js"),i=d(h),j=a("./abr/ABRRulesCollection.js"),k=d(j),l=a("./synchronization/SynchronizationRulesCollection.js"),m=d(l),n=a("../../core/FactoryMaker.js"),o=d(n),p=0,q=1;e.__dashjs_factory_name="RulesController";var r=o["default"].getSingletonFactory(e);r.ABR_RULE=p,r.SYNC_RULE=q,c["default"]=r,b.exports=c["default"]},{"../../core/FactoryMaker.js":9,"./RulesContext.js":117,"./SwitchRequest.js":119,"./abr/ABRRulesCollection.js":120,"./synchronization/SynchronizationRulesCollection.js":133}],119:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a,b){var c=void 0===a?h:a,d=void 0===b?i:b,e={value:c,priority:d};return e}Object.defineProperty(c,"__esModule",{value:!0});var f=a("../../core/FactoryMaker.js"),g=d(f),h=999,i=.5,j=1,k=0;e.__dashjs_factory_name="SwitchRequest";var l=g["default"].getClassFactory(e);l.NO_CHANGE=h,l.DEFAULT=i,l.STRONG=j,l.WEAK=k,c["default"]=l,b.exports=c["default"]},{"../../core/FactoryMaker.js":9}],120:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(){function a(){e=[],f=[];var a=(0,u["default"])(c).getInstance(),b=(0,w["default"])(c).getInstance(),d=(0,s["default"])(c).getInstance();d.getBufferOccupancyABREnabled()?(e.push((0,o["default"])(c).create({metricsModel:a,dashMetrics:(0,w["default"])(c).getInstance()})),f.push((0,q["default"])(c).create({metricsModel:a,dashMetrics:(0,w["default"])(c).getInstance()}))):(e.push((0,g["default"])(c).create({metricsModel:a,dashMetrics:b})),e.push((0,i["default"])(c).create({metricsModel:a,dashMetrics:b})),e.push((0,k["default"])(c).create({metricsModel:a})),f.push((0,m["default"])(c).create()))}function b(a){switch(a){case z:return e;case A:return f;default:return null}}var c=this.context,d=void 0,e=void 0,f=void 0;return d={initialize:a,getRules:b}}Object.defineProperty(c,"__esModule",{value:!0});var f=a("./ThroughputRule.js"),g=d(f),h=a("./BufferOccupancyRule.js"),i=d(h),j=a("./InsufficientBufferRule.js"),k=d(j),l=a("./AbandonRequestsRule.js"),m=d(l),n=a("./BolaRule.js"),o=d(n),p=a("./BolaAbandonRule.js"),q=d(p),r=a("../../models/MediaPlayerModel.js"),s=d(r),t=a("../../models/MetricsModel.js"),u=d(t),v=a("../../../dash/DashMetrics.js"),w=d(v),x=a("../../../core/FactoryMaker.js"),y=d(x),z="qualitySwitchRules",A="abandonFragmentRules";e.__dashjs_factory_name="ABRRulesCollection";var B=y["default"].getSingletonFactory(e);B.QUALITY_SWITCH_RULES=z,B.ABANDON_FRAGMENT_RULES=A,c["default"]=B,b.exports=c["default"]},{"../../../core/FactoryMaker.js":9,"../../../dash/DashMetrics.js":15,"../../models/MediaPlayerModel.js":90,"../../models/MetricsModel.js":91,"./AbandonRequestsRule.js":121,"./BolaAbandonRule.js":122,"./BolaRule.js":123,"./BufferOccupancyRule.js":124,"./InsufficientBufferRule.js":125,"./ThroughputRule.js":126}],121:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(){function a(){j={},k={},l=(0,i["default"])(e).getInstance()}function b(a,b){j[a]=j[a]||{},j[a][b]=j[a][b]||{}}function c(a,c){var d,h=(new Date).getTime(),i=a.getMediaInfo(),m=i.type,p=a.getCurrentValue(),q=a.getTrackInfo(),r=p.request,s=a.getStreamProcessor().getABRController(),t=(0,g["default"])(e).create(g["default"].NO_CHANGE,g["default"].WEAK);if(!isNaN(r.index)){if(b(m,r.index),d=j[m][r.index],null===d||null===r.firstByteDate||k.hasOwnProperty(d.id))return void c(t);if(void 0===d.firstByteTime&&(d.firstByteTime=r.firstByteDate.getTime(),d.segmentDuration=r.duration,d.bytesTotal=r.bytesTotal,d.id=r.index),d.bytesLoaded=r.bytesLoaded,d.elapsedTime=h-d.firstByteTime,d.bytesLoaded=n){if(d.measuredBandwidthInKbps=Math.round(8*d.bytesLoaded/d.elapsedTime),d.estimatedTimeOfDownload=(8*d.bytesTotal*.001/d.measuredBandwidthInKbps).toFixed(2),d.estimatedTimeOfDownloadd.index||b==d.index&&cE&&(E=.001*j);var F="index="+u+" quality="+v+" bytesLoaded/bytesTotal="+y+"/"+z+" bufferLevel="+C+" timeSince1stByte="+(x/1e3).toFixed(3)+" estThroughput="+(D/1e6).toFixed(3)+" latency="+E.toFixed(3),G=z*t.bitrate[0]/t.bitrate[v],H=A-E*D/8;if(1>H&&(H=1),h>x||G>=A||C>t.bufferTarget||G>=H||B>=8*z/D)return void b(s);if(t.safetyGuarantee&&C<=t.fragmentDuration&&t.state===o["default"].BOLA_STATE_STEADY)return t.lastQuality=0,p.updateBolaState(f,t),c(f,u,v),s=(0,g["default"])(k).create(0,g["default"].STRONG),o["default"].BOLA_DEBUG&&l("BolaDebug "+f+" BolaAbandonRule to 0 for safety guarantee - "+F),void b(s);var I=8*A/D,J=v;if(I>C)for(--J;J>0&&(G=z*t.bitrate[J]/t.bitrate[v],I=E+8*G/D,!(C>=I));)--J;for(var K=C+t.virtualBuffer-E,L=v,M=(t.utility[v]+t.gp-K/t.Vp)/H,N=0;v>N&&(G=z*t.bitrate[N]/t.bitrate[v],!(G>H));++N){var O=(t.utility[N]+t.gp-K/t.Vp)/G;O>M&&(L=N,M=O)}if(L>J&&(L=J),L===v)return void b(s);for(;L>0&&t.bitrate[L]>D;)--L;t.lastQuality=L,p.updateBolaState(f,t),c(f,u,v),s=(0,g["default"])(k).create(L,g["default"].STRONG),o["default"].BOLA_DEBUG&&l("BolaDebug "+f+" BolaAbandonRule abandon to "+L+" - "+F),b(s)}function f(){r={}}var h=500,j=200,k=this.context,l=(0,m["default"])(k).getInstance().log,n=a.dashMetrics,p=a.metricsModel,q=void 0,r=void 0,s=void 0;return q={execute:e,reset:f},b(),q}Object.defineProperty(c,"__esModule",{value:!0});var f=a("../SwitchRequest.js"),g=d(f),h=a("../../models/MediaPlayerModel.js"),i=d(h),j=a("../../../core/FactoryMaker.js"),k=d(j),l=a("../../../core/Debug.js"),m=d(l),n=a("./BolaRule.js"),o=d(n);e.__dashjs_factory_name="BolaAbandonRule",c["default"]=k["default"].getClassFactory(e),b.exports=c["default"]},{"../../../core/Debug.js":7,"../../../core/FactoryMaker.js":9,"../../models/MediaPlayerModel.js":90,"../SwitchRequest.js":119,"./BolaRule.js":123}],123:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a){function b(){I={},J=[],K=(0,k["default"])(C).getInstance(),L=(0,m["default"])(C).getInstance(),M=(0,q["default"])(C).getInstance(),G.on(u["default"].PLAYBACK_SEEKING,j,H),G.on(u["default"].PERIOD_SWITCH_STARTED,l,H)}function c(a){var b={},c=a.getMediaInfo(),d=c.bitrateList.map(function(a){return a.bandwidth}),e=d.length;if(2>e||d[0]>=d[1]||d[e-2]>=d[e-1])return b.state=x,b;var f=a.getStreamProcessor(),g=a.getStreamInfo(),h=a.getTrackInfo(),i=f.isDynamic(),j=g.manifestInfo.duration,k=h.fragmentDuration,l=void 0,m=void 0;l=K.getStableBufferTime(),m=j>=K.getLongFormContentDurationThreshold()?K.getBufferTimeAtTopQualityLongForm():K.getBufferTimeAtTopQuality();var n=l;k+r>n&&(n=k+r);for(var o=[],p=0;e>p;++p)o.push(Math.log(d[p]/d[0]));var q=(n-k)/o[e-1],s=1+o[e-1]/(n/k-1),u=.2,w=!i&&n===l;if(w){for(var z=q,A=s,p=1;e>p;++p){var C=z*(A-d[0]*o[p]/(d[p]-d[0])),E=k*(2-d[0]/d[p])+u;if(E>=l){w=!1;break}E>C&&(z*=(l-E)/(l-C),A=E/z+o[p]*d[0]/(d[p]-d[0]))}w&&r>(l-k)*z/q&&(w=!1),w&&(q=z,s=A)}var F=q*(o[e-1]+s);if(b.state=y,b.bitrate=d,b.utility=o,b.Vp=q,b.gp=s,b.fragmentDuration=k,b.bandwidthSafetyFactor=K.getBandwidthSafetyFactor(),b.bufferTarget=l,b.bufferMax=m,b.bolaBufferTarget=n,b.bolaBufferMax=F,b.isDynamic=i,b.safetyGuarantee=w,b.lastQuality=0,b.virtualBuffer=0,b.throughputCount=i?t:v,B){for(var G="",p=0;pf;++f){var g=(a.utility[f]+a.gp-b/a.Vp)/a.bitrate[f];g>e&&(e=g,d=f)}return d}function e(a,b){for(var c=E.getHttpRequests(a),d=[],e=c.length-1;e>=0;--e){var f=c[e];if(f.type===o["default"].MEDIA_SEGMENT_TYPE&&f._tfinish&&f.tresponse&&f.trace&&(d.push(f),d.length===b))break}return d}function f(a,b,c){var d=e(a,b);if(0===d.length)return 0;for(var f=0,g="",h=0;hb);++d)c=d;return c}function i(a,b){var c=e(a,1);if(0===c.length)return 0;var d=c[0],f=(new Date).getTime(),g=d._tfinish.getTime();g>f&&(g=f);var h=I[b];I[b]=f;var i=0;return i=h&&h>g?f-h:f-g,0>i?0:.001*i}function j(){for(var a=0;a=r&&(q.virtualBuffer=0),!q.safetyGuarantee){var u=i(m,l);u>0&&(q.virtualBuffer+=u),r+q.virtualBuffer>q.bolaBufferMax&&(q.virtualBuffer=q.bolaBufferMax-r),q.virtualBuffer<0&&(q.virtualBuffer=0);var v=d(q,r+q.virtualBuffer);if(v>s){for(var w=s;v>w&&q.bitrate[w+1]*q.fragmentDuration/(t*q.bandwidthSafetyFactor)s)if(w>=v)s=v;else{s=w;var G=q.Vp*(q.gp+q.utility[s]);r+q.virtualBuffer>G&&(q.virtualBuffer=G-r,q.virtualBuffer<0&&(q.virtualBuffer=0))}}}if(q.state===y||q.state===z){var o=h(q,t*q.bandwidthSafetyFactor);if(0>=t&&(q.state=A),q.state===y&&oq.lastQuality&&(o=q.lastQuality),s>=o&&(q.state=A),q.state!==A)return B&&D("BolaDebug "+l+" BolaRule quality "+o+">"+s+" for STARTUP"),q.lastQuality=o,F.updateBolaState(l,q),j=(0,g["default"])(C).create(o,g["default"].DEFAULT),void b(j)}var H=0;if(s>q.lastQuality){var o=h(q,t);if(s>o){if(o0&&(H>q.virtualBuffer?(H-=q.virtualBuffer,q.virtualBuffer=0):(q.virtualBuffer-=H,H=0)),H>0&&e.getScheduleController().setTimeToLoadDelay(1e3*H),q.lastQuality=s,F.updateBolaState(l,q),j=(0,g["default"])(C).create(s,g["default"].DEFAULT),B&&D("BolaDebug "+l+" BolaRule quality "+s+" delay="+H.toFixed(3)+" for STEADY"),b(j)}function p(){G.off(u["default"].PLAYBACK_SEEKING,j,H),G.off(u["default"].PERIOD_SWITCH_STARTED,l,H),b()}var r=5,t=2,v=3,C=this.context,D=(0,w["default"])(C).getInstance().log,E=a.dashMetrics,F=a.metricsModel,G=(0,s["default"])(C).getInstance(),H=void 0,I=void 0,J=void 0,K=void 0,L=void 0,M=void 0;return H={execute:n,reset:p},b(),H}Object.defineProperty(c,"__esModule",{value:!0});var f=a("../SwitchRequest.js"),g=d(f),h=a("../../../core/FactoryMaker.js"),i=d(h),j=a("../../models/MediaPlayerModel.js"),k=d(j),l=a("../../controllers/PlaybackController.js"),m=d(l),n=a("../../vo/metrics/HTTPRequest.js"),o=d(n),p=a("../../../dash/DashAdapter.js"),q=d(p),r=a("../../../core/EventBus.js"),s=d(r),t=a("../../../core/events/Events.js"),u=d(t),v=a("../../../core/Debug.js"),w=d(v),x=0,y=1,z=2,A=3,B=!1;e.__dashjs_factory_name="BolaRule";var C=i["default"].getClassFactory(e);C.BOLA_STATE_ONE_BITRATE=x,C.BOLA_STATE_STARTUP=y,C.BOLA_STATE_STARTUP_NO_INC=z,C.BOLA_STATE_STEADY=A,C.BOLA_DEBUG=B,c["default"]=C,b.exports=c["default"]},{"../../../core/Debug.js":7,"../../../core/EventBus.js":8,"../../../core/FactoryMaker.js":9,"../../../core/events/Events.js":11,"../../../dash/DashAdapter.js":13,"../../controllers/PlaybackController.js":57,"../../models/MediaPlayerModel.js":90,"../../vo/metrics/HTTPRequest.js":166,"../SwitchRequest.js":119}],124:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a){function b(){m=0,n=(0,i["default"])(f).getInstance()}function c(a,b){var c=(new Date).getTime()/1e3,d=a.getMediaInfo(),e=a.getTrackInfo(),i=d.type,o=isNaN(e.fragmentDuration)?2:e.fragmentDuration/2,p=a.getCurrentValue(),q=a.getStreamProcessor(),r=q.getABRController(),s=j.getReadOnlyMetricsFor(i),t=l.getCurrentBufferLevel(s),u=s.BufferState.length>0?s.BufferState[s.BufferState.length-1]:null,v=!1,w=d.representationCount-1,x=(0,g["default"])(f).create(g["default"].NO_CHANGE,g["default"].WEAK);return o>c-m||r.getAbandonmentStateFor(i)===k["default"].ABANDON_LOAD?void b(x):(null!==u&&t>u.target&&(v=t-u.target>n.getRichBufferThreshold(),v&&d.representationCount>1&&(x=(0,g["default"])(f).create(w,g["default"].STRONG))),x.value!==g["default"].NO_CHANGE&&x.value!==p&&h("BufferOccupancyRule requesting switch to index: ",x.value,"type: ",i," Priority: ",x.priority===g["default"].DEFAULT?"Default":x.priority===g["default"].STRONG?"Strong":"Weak"),void b(x))}function d(){m=0}var e=void 0,f=this.context,h=(0,o["default"])(f).getInstance().log,j=a.metricsModel,l=a.dashMetrics,m=void 0,n=void 0;return e={execute:c,reset:d},b(),e}Object.defineProperty(c,"__esModule",{value:!0});var f=a("../SwitchRequest.js"),g=d(f),h=a("../../models/MediaPlayerModel.js"),i=d(h),j=a("../../controllers/AbrController.js"),k=d(j),l=a("../../../core/FactoryMaker.js"),m=d(l),n=a("../../../core/Debug.js"),o=d(n);e.__dashjs_factory_name="BufferOccupancyRule",c["default"]=m["default"].getClassFactory(e),b.exports=c["default"]},{"../../../core/Debug.js":7,"../../../core/FactoryMaker.js":9,"../../controllers/AbrController.js":49,"../../models/MediaPlayerModel.js":90,"../SwitchRequest.js":119}],125:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a){function b(){p={},r=0,s=1e3,l.on(m["default"].PLAYBACK_SEEKING,e,o)}function c(a,b){var c=(new Date).getTime(),e=a.getMediaInfo().type,f=a.getCurrentValue(),k=n.getReadOnlyMetricsFor(e),l=k.BufferState.length>0?k.BufferState[k.BufferState.length-1]:null,m=(0,g["default"])(h).create(g["default"].NO_CHANGE,g["default"].WEAK);return s>c-r||null===l?void b(m):(d(e,l.state),l.state===i["default"].BUFFER_EMPTY&&void 0!==p[e].firstBufferLoadedEvent&&(m=(0,g["default"])(h).create(0,g["default"].STRONG)),m.value!==g["default"].NO_CHANGE&&m.value!==f&&j("InsufficientBufferRule requesting switch to index: ",m.value,"type: ",e," Priority: ",m.priority===g["default"].DEFAULT?"Default":m.priority===g["default"].STRONG?"Strong":"Weak"),r=c,void b(m))}function d(a,b){p[a]=p[a]||{},p[a].state=b,b!==i["default"].BUFFER_LOADED||p[a].firstBufferLoadedEvent||(p[a].firstBufferLoadedEvent=!0)}function e(){p={}}function f(){l.off(m["default"].PLAYBACK_SEEKING,e,o),p={},r=0}var h=this.context,j=(0,q["default"])(h).getInstance().log,l=(0,k["default"])(h).getInstance(),n=a.metricsModel,o=void 0,p=void 0,r=void 0,s=void 0;return o={execute:c,reset:f},b(),o}Object.defineProperty(c,"__esModule",{value:!0});var f=a("../SwitchRequest.js"),g=d(f),h=a("../../controllers/BufferController.js"),i=d(h),j=a("../../../core/EventBus.js"),k=d(j),l=a("../../../core/events/Events.js"),m=d(l),n=a("../../../core/FactoryMaker.js"),o=d(n),p=a("../../../core/Debug.js"),q=d(p);e.__dashjs_factory_name="InsufficientBufferRule",c["default"]=o["default"].getClassFactory(e),b.exports=c["default"]},{"../../../core/Debug.js":7,"../../../core/EventBus.js":8,"../../../core/FactoryMaker.js":9,"../../../core/events/Events.js":11,"../../controllers/BufferController.js":52,"../SwitchRequest.js":119}],126:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a){function b(){t=[],u=(0,m["default"])(l).getInstance()}function c(a,b){t[a]=t[a]||[],b!==1/0&&b!==t[a][t[a].length-1]&&t[a].push(b)}function d(a,b){var c=0,d=b?h:j,e=t[a],f=e.length;if(d=d>f?f:d,f>0){for(var g=f-d,i=0,k=g;f>k;k++)i+=e[k];c=i/d}return e.length>d&&e.shift(),c/1e3*u.getBandwidthSafetyFactor()}function e(a,b){var e,f,h,j,m=a.getMediaInfo(),r=m.type,s=a.getCurrentValue(),t=q.getReadOnlyMetricsFor(r),u=a.getStreamProcessor(),v=u.getABRController(),w=u.isDynamic(),x=p.getCurrentHttpRequest(t),y=t.BufferState.length>0?t.BufferState[t.BufferState.length-1]:null,z=t.BufferLevel.length>0?t.BufferLevel[t.BufferLevel.length-1]:null,A=(0, +g["default"])(l).create(g["default"].NO_CHANGE,g["default"].WEAK);if(!(t&&x&&x.type===o["default"].MEDIA_SEGMENT_TYPE&&y&&z))return void b(A);if(x.trace&&x.trace.length&&(e=(x._tfinish.getTime()-x.tresponse.getTime())/1e3,f=x.trace.reduce(function(a,b){return a+b.b[0]},0),j=Math.round(8*f)/e,c(r,j)),h=Math.round(d(r,w)),v.setAverageThroughput(r,h),v.getAbandonmentStateFor(r)!==k["default"].ABANDON_LOAD){if(y.state===i["default"].BUFFER_LOADED||w){var B=v.getQualityForBitrate(m,h);u.getScheduleController().setTimeToLoadDelay(0),A=(0,g["default"])(l).create(B,g["default"].DEFAULT)}A.value!==g["default"].NO_CHANGE&&A.value!==s&&n("ThroughputRule requesting switch to index: ",A.value,"type: ",r," Priority: ",A.priority===g["default"].DEFAULT?"Default":A.priority===g["default"].STRONG?"Strong":"Weak","Average throughput",Math.round(h),"kbps")}b(A)}function f(){b()}var h=2,j=3,l=this.context,n=(0,s["default"])(l).getInstance().log,p=a.dashMetrics,q=a.metricsModel,r=void 0,t=void 0,u=void 0;return r={execute:e,reset:f},b(),r}Object.defineProperty(c,"__esModule",{value:!0});var f=a("../SwitchRequest.js"),g=d(f),h=a("../../controllers/BufferController.js"),i=d(h),j=a("../../controllers/AbrController.js"),k=d(j),l=a("../../models/MediaPlayerModel.js"),m=d(l),n=a("../../vo/metrics/HTTPRequest.js"),o=d(n),p=a("../../../core/FactoryMaker.js"),q=d(p),r=a("../../../core/Debug.js"),s=d(r);e.__dashjs_factory_name="ThroughputRule",c["default"]=q["default"].getClassFactory(e),b.exports=c["default"]},{"../../../core/Debug.js":7,"../../../core/FactoryMaker.js":9,"../../controllers/AbrController.js":49,"../../controllers/BufferController.js":52,"../../models/MediaPlayerModel.js":90,"../../vo/metrics/HTTPRequest.js":166,"../SwitchRequest.js":119}],127:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a){function b(a){var b,c=0;return a&&a.some(function(a,b){return c=b,!d.contains(a.serviceLocation)})&&(b=a[c]),b}var c=void 0,d=a.blacklistController;return c={select:b}}Object.defineProperty(c,"__esModule",{value:!0});var f=a("../../../core/FactoryMaker.js"),g=d(f);e.__dashjs_factory_name="BasicSelector",c["default"]=g["default"].getClassFactory(e),b.exports=c["default"]},{"../../../core/FactoryMaker.js":9}],128:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a){function b(a){var b=[],c=function(a){return b.length&&a.dvb_priority&&-1!==b.indexOf(a.dvb_priority)?!1:!0},d=function(a){return f.contains(a.serviceLocation)?(a.dvb_priority&&b.push(a.dvb_priority),!1):!0};return a.filter(d).filter(c)}function c(a){var b,c,d=function(a,b){var c=a.dvb_priority-b.dvb_priority;return isNaN(c)?0:c},e=function(a,b,c){return!b||c[0].dvb_priority&&a.dvb_priority&&c[0].dvb_priority===a.dvb_priority},f=0,g=[],h=0;return c=a.sort(d).filter(e),c.length?(c.length>1&&(c.forEach(function(a){f+=a.dvb_weight,g.push(f)}),b=Math.floor(Math.random()*(f-1)),g.every(function(a,c){return h=c,a>b?!1:!0})),c[h]):void 0}function d(a){return a&&c(b(a))}var e=void 0,f=a.blacklistController;return e={select:d}}Object.defineProperty(c,"__esModule",{value:!0});var f=a("../../../core/FactoryMaker.js"),g=d(f);e.__dashjs_factory_name="DVBSelector",c["default"]=g["default"].getClassFactory(e),b.exports=c["default"]},{"../../../core/FactoryMaker.js":9}],129:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a){function b(){m=(0,g["default"])(h).getInstance(),n=(0,i["default"])(h).getInstance()}function c(a){var b=a.getCurrentRepresentationInfo(),c=b.mediaInfo,d=c.type,f=k.getReadOnlyMetricsFor(d),g=j.getCurrentBufferLevel(f);return g=m.getLongFormContentDurationThreshold(),i=NaN;return i="fragmentedText"===b?l.getAllTracksAreDisabled()?0:c.fragmentDuration:f.isPlayingAtTopQuality(e)?h?m.getBufferTimeAtTopQualityLongForm():m.getBufferTimeAtTopQuality():m.getStableBufferTime()}var f=void 0,h=this.context,j=a.dashMetrics,k=a.metricsModel,l=a.textSourceBuffer,m=void 0,n=void 0;return f={execute:c,reset:d},b(),f}Object.defineProperty(c,"__esModule",{value:!0});var f=a("../../models/MediaPlayerModel.js"),g=d(f),h=a("../../controllers/PlaybackController.js"),i=d(h),j=a("../../../core/FactoryMaker.js"),k=d(j);e.__dashjs_factory_name="BufferLevelRule",c["default"]=k["default"].getClassFactory(e),b.exports=c["default"]},{"../../../core/FactoryMaker.js":9,"../../controllers/PlaybackController.js":57,"../../models/MediaPlayerModel.js":90}],130:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a){function b(a){var b=a.getCurrentRepresentationInfo(),c=b.mediaInfo,d=c.type,g=c.streamInfo.id,k=a.getScheduleController(),l=k.getSeekTarget(),m=!isNaN(l),n=!m,o=m?l:f.getIndexHandlerTime(a),p=a.getBuffer(),q=null,r=void 0,s=void 0;if(isNaN(o)||"fragmentedText"===d&&j.getAllTracksAreDisabled())return null;if(m&&k.setSeekTarget(NaN),p&&(q=h.getBufferRange(a.getBuffer(),o),null!==q&&(r=i.getChunks({streamId:g,mediaType:d,appended:!0,mediaInfo:c,forRange:q}),r&&r.length>0))){var t=o;o=r[r.length-1].bufferedRange.end,e("Prior to making a request for time, NextFragmentRequestRule is aligning index handler's currentTime with bufferedRange.end.",t," was changed to ",o)}return s=f.getFragmentRequestForTime(a,b,o,{keepIdx:n}),s&&a.getFragmentModel().isFragmentLoaded(s)&&(s=f.getNextFragmentRequest(a,b)),s&&(f.setIndexHandlerTime(a,s.startTime+s.duration),s.delayLoadingTime=(new Date).getTime()+k.getTimeToLoadDelay(),k.setTimeToLoadDelay(0)),s}var c=void 0,d=this.context,e=(0,g["default"])(d).getInstance().log,f=a.adapter,h=a.sourceBufferController,i=a.virtualBuffer,j=a.textSourceBuffer;return c={execute:b}}Object.defineProperty(c,"__esModule",{value:!0});var f=a("../../../core/Debug.js"),g=d(f),h=a("../../../core/FactoryMaker.js"),i=d(h);e.__dashjs_factory_name="NextFragmentRequestRule",c["default"]=i["default"].getClassFactory(e),b.exports=c["default"]},{"../../../core/Debug.js":7,"../../../core/FactoryMaker.js":9}],131:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a){function b(){r=NaN,s=null,t=NaN,u=null,v=!1,w=NaN,x=g["default"].DEFAULT}function c(a,b){var c,d;if(y=b,A=a.getStreamProcessor(),z=A.getFragmentLoader(),u=a.getTrackInfo(),w=u.fragmentDuration,d=u.DVRWindow,r=d.end,u.useCalculatedLiveEdgeTime){var i=p.getExpectedLiveEdge();return p.setExpectedLiveEdge(r),void y((0,g["default"])(l).create(i,x))}s={start:Math.max(0,r-n),end:r+n},t=Math.floor((d.end-d.start)/2),c=o.getFragmentRequestForTime(A,u,r,{ignoreIsFinished:!0}),e(r,h,f,c)}function d(){r=NaN,s=null,t=NaN,u=null,v=!1,w=NaN,A=null,z=null}function e(a,b,c,d){var f;if(null===d)f=o.generateFragmentRequestForTime(A,u,a),e(a,b,c,f);else{var g=function h(d){m.off(k["default"].CHECK_FOR_EXISTENCE_COMPLETED,h,this),d.exists?b(d.request,a):c(d.request,a)};m.on(k["default"].CHECK_FOR_EXISTENCE_COMPLETED,g,this),z.checkForExistence(d)}}function f(a,b){var c,d,i;return v?void j(!1,b):(i=b-r,c=i>0?r-i:r+Math.abs(i)+t,void(cs.end?y((0,g["default"])(l).create(null,x)):(d=o.getFragmentRequestForTime(A,u,c,{ignoreIsFinished:!0}),e(c,h,f,d))))}function h(a,b){var c,d,f=a.startTime;if(!v){if(!u.fragmentDuration)return void y((0,g["default"])(l).create(f,x));if(v=!0,s.end=f+2*t,b===r)return d=b+w,c=o.getFragmentRequestForTime(A,u,d,{ignoreIsFinished:!0}),void e(d,function(){j(!0,d)},function(){y((0,g["default"])(l).create(d,x))},c)}j(!0,b)}function j(a,b){var c,d,i;a?s.start=b:s.end=b,c=Math.floor(s.end-s.start)<=w,c?y((0,g["default"])(l).create(a?b:b-w,x)):(i=(s.start+s.end)/2,d=o.getFragmentRequestForTime(A,u,i,{ignoreIsFinished:!0}),e(i,h,f,d))}var l=this.context,m=(0,i["default"])(l).getInstance(),o=a.adapter,p=a.timelineConverter,q=void 0,r=void 0,s=void 0,t=void 0,u=void 0,v=void 0,w=void 0,x=void 0,y=void 0,z=void 0,A=void 0;return q={execute:c,reset:d},b(),q}Object.defineProperty(c,"__esModule",{value:!0});var f=a("../SwitchRequest.js"),g=d(f),h=a("../../../core/EventBus.js"),i=d(h),j=a("../../../core/events/Events.js"),k=d(j),l=a("../../../core/FactoryMaker.js"),m=d(l),n=43200;e.__dashjs_factory_name="LiveEdgeBinarySearchRule",c["default"]=m["default"].getClassFactory(e),b.exports=c["default"]},{"../../../core/EventBus.js":8,"../../../core/FactoryMaker.js":9,"../../../core/events/Events.js":11,"../SwitchRequest.js":119}],132:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a){function b(a,b){var c=a.getTrackInfo(),f=c.DVRWindow.end,h=g["default"].DEFAULT;if(c.useCalculatedLiveEdgeTime){var i=e.getExpectedLiveEdge();e.setExpectedLiveEdge(f),b((0,g["default"])(d).create(i,h))}else b((0,g["default"])(d).create(f,h))}var c=void 0,d=this.context,e=a.timelineConverter;return c={execute:b}}Object.defineProperty(c,"__esModule",{value:!0});var f=a("../SwitchRequest.js"),g=d(f),h=a("../../../core/FactoryMaker.js"),i=d(h);e.__dashjs_factory_name="LiveEdgeWithTimeSynchronizationRule",c["default"]=i["default"].getClassFactory(e),b.exports=c["default"]},{"../../../core/FactoryMaker.js":9,"../SwitchRequest.js":119}],133:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(){function a(){e=[],f=[],e.push((0,m["default"])(c).create({timelineConverter:(0,i["default"])(c).getInstance()})),f.push((0,k["default"])(c).create({timelineConverter:(0,i["default"])(c).getInstance(),adapter:(0,o["default"])(c).getInstance()}))}function b(a){switch(a){case p:return e;case q:return f;default:return null}}var c=this.context,d=void 0,e=void 0,f=void 0;return d={initialize:a,getRules:b}}Object.defineProperty(c,"__esModule",{value:!0});var f=a("../../../core/FactoryMaker.js"),g=d(f),h=a("../../../dash/utils/TimelineConverter.js"),i=d(h),j=a("./LiveEdgeBinarySearchRule.js"),k=d(j),l=a("./LiveEdgeWithTimeSynchronizationRule.js"),m=d(l),n=a("../../../dash/DashAdapter.js"),o=d(n),p="withAccurateTimeSourceRules",q="bestGuestRules";e.__dashjs_factory_name="SynchronizationRulesCollection";var r=g["default"].getSingletonFactory(e);r.TIME_SYNCHRONIZED_RULES=p,r.BEST_GUESS_RULES=q,c["default"]=r,b.exports=c["default"]},{"../../../core/FactoryMaker.js":9,"../../../dash/DashAdapter.js":13,"../../../dash/utils/TimelineConverter.js":25,"./LiveEdgeBinarySearchRule.js":131,"./LiveEdgeWithTimeSynchronizationRule.js":132}],134:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(){function a(){l=(0,m["default"])(e).create({updateEventName:i["default"].SERVICE_LOCATION_BLACKLIST_CHANGED,loadFailedEventName:i["default"].FRAGMENT_LOADING_COMPLETED}),n=(0,q["default"])(e).create({blacklistController:l}),p=(0,o["default"])(e).create({blacklistController:l}),r=n}function b(a){r=h.getIsDVB(a)?p:n}function c(a){var b=a.baseUrls,c=a.selectedIdx;if(!isNaN(c))return b[c];var d=r.select(b);return d?(a.selectedIdx=b.indexOf(d),d):void f.trigger(i["default"].URL_RESOLUTION_FAILED,{error:new Error(t,u)})}function d(){l.reset()}var e=this.context,f=(0,g["default"])(e).getInstance(),h=(0,k["default"])(e).getInstance(),j=void 0,l=void 0,n=void 0,p=void 0,r=void 0;return j={chooseSelectorFromManifest:b,select:c,reset:d},a(),j}Object.defineProperty(c,"__esModule",{value:!0});var f=a("../../core/EventBus.js"),g=d(f),h=a("../../core/events/Events.js"),i=d(h),j=a("../../dash/models/DashManifestModel.js"),k=d(j),l=a("../controllers/BlacklistController.js"),m=d(l),n=a("../rules/baseUrlResolution/DVBSelector.js"),o=d(n),p=a("../rules/baseUrlResolution/BasicSelector.js"),q=d(p),r=a("../../core/FactoryMaker.js"),s=d(r),t=1,u="Failed to resolve a valid URL";e.__dashjs_factory_name="BaseURLSelector";var v=s["default"].getClassFactory(e);v.URL_RESOLUTION_FAILED_GENERIC_ERROR_CODE=t,v.URL_RESOLUTION_FAILED_GENERIC_ERROR_MESSAGE=u,c["default"]=v,b.exports=c["default"]},{"../../core/EventBus.js":8,"../../core/FactoryMaker.js":9,"../../core/events/Events.js":11,"../../dash/models/DashManifestModel.js":19,"../controllers/BlacklistController.js":51,"../rules/baseUrlResolution/BasicSelector.js":127,"../rules/baseUrlResolution/DVBSelector.js":128}],135:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(){function a(a){if(!a)return null;void 0===a.fileStart&&(a.fileStart=0);var b=k["default"].parseBuffer(a),d=(0,g["default"])(c).create();return d.setData(b),d}var b=void 0,c=this.context;return b={parse:a}}Object.defineProperty(c,"__esModule",{value:!0});var f=a("./IsoFile.js"),g=d(f),h=a("../../core/FactoryMaker.js"),i=d(h),j=a("codem-isoboxer"),k=d(j);e.__dashjs_factory_name="BoxParser",c["default"]=i["default"].getSingletonFactory(e),b.exports=c["default"]},{"../../core/FactoryMaker.js":9,"./IsoFile.js":140,"codem-isoboxer":6}],136:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(){function a(){g=!1}function b(){var a="WebKitMediaSource"in window,b="MediaSource"in window;return a||b}function c(){return g}function d(a){g=a}function e(a,b){var c=a.canPlayType(b);return"probably"===c||"maybe"===c}var f=void 0,g=void 0;return f={supportsMediaSource:b,supportsEncryptedMedia:c,supportsCodec:e,setEncryptedMediaSupported:d},a(),f}Object.defineProperty(c,"__esModule",{value:!0});var f=a("../../core/FactoryMaker.js"),g=d(f);e.__dashjs_factory_name="Capabilities",c["default"]=g["default"].getSingletonFactory(e),b.exports=c["default"]},{"../../core/FactoryMaker.js":9}],137:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(){function a(a,b){var c=0;for(c=0;cthis.customTimeRangeArray[c].start;c++);for(this.customTimeRangeArray.splice(c,0,{start:a,end:b}),c=0;c=this.customTimeRangeArray[c].end)this.customTimeRangeArray.splice(c,1),c--;else{if(a>this.customTimeRangeArray[c].start&&bthis.customTimeRangeArray[c].start&&athis.customTimeRangeArray[c].start&&b=u.getLastMediaSettingsCachingInfo().ttl||!1,f=c.settings;return d&&(localStorage.removeItem(b),f=null),f}function g(a){var b=NaN;if(e(o,"LastBitrate")){var c=m.replace(/\?/,a),d=JSON.parse(localStorage.getItem(c))||{},f=(new Date).getTime()-parseInt(d.timestamp,10)>=u.getLastBitrateCachingInfo().ttl||!1,g=parseInt(d.bitrate,10);isNaN(g)||f?f&&localStorage.removeItem(c):(b=g,r("Last saved bitrate for "+a+" was "+g))}return b}function h(a,b){if(e(o,"LastMediaSettings")){var c=n.replace(/\?/,a);try{localStorage.setItem(c,JSON.stringify({settings:b,timestamp:d()}))}catch(f){r(f.message)}}}function j(a,b){if(e(o,"LastBitrate")&&b){var c=m.replace(/\?/,a);try{localStorage.setItem(c,JSON.stringify({bitrate:b/1e3,timestamp:d()}))}catch(f){r(f.message)}}}var q=this.context,r=(0,k["default"])(q).getInstance().log,s=void 0,t=void 0,u=void 0;return s={getSavedBitrateSettings:g,setSavedBitrateSettings:j,getSavedMediaSettings:f,setSavedMediaSettings:h,isSupported:a},c(),s}Object.defineProperty(c,"__esModule",{value:!0});var f=a("../../core/FactoryMaker.js"),g=d(f),h=a("../models/MediaPlayerModel.js"),i=d(h),j=a("../../core/Debug.js"),k=d(j),l=[{oldKey:"dashjs_vbitrate",newKey:"dashjs_video_bitrate"},{oldKey:"dashjs_abitrate",newKey:"dashjs_audio_bitrate"},{oldKey:"dashjs_vsettings",newKey:"dashjs_video_settings"},{oldKey:"dashjs_asettings",newKey:"dashjs_audio_settings"}],m="dashjs_?_bitrate",n="dashjs_?_settings",o="localStorage",p="sessionStorage";e.__dashjs_factory_name="DOMStorage";var q=g["default"].getSingletonFactory(e);c["default"]=q,b.exports=c["default"]},{"../../core/Debug.js":7,"../../core/FactoryMaker.js":9,"../models/MediaPlayerModel.js":90}],139:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(){function a(a){l.trigger(i["default"].ERROR,{error:"capability",event:a})}function b(a,b,c){l.trigger(i["default"].ERROR,{error:"download",event:{id:a,url:b,request:c}})}function c(a,b,c){l.trigger(i["default"].ERROR,{error:"manifestError",event:{message:a,id:b,manifest:c}})}function d(a,b,c){l.trigger(i["default"].ERROR,{error:"cc",event:{message:a,id:b,cc:c}})}function e(a){l.trigger(i["default"].ERROR,{error:"mediasource",event:a})}function f(a){l.trigger(i["default"].ERROR,{error:"key_session",event:a})}function h(a){l.trigger(i["default"].ERROR,{error:"key_message",event:a})}var j=void 0,k=this.context,l=(0,g["default"])(k).getInstance();return j={capabilityError:a,downloadError:b,manifestError:c,timedTextError:d,mediaSourceError:e,mediaKeySessionError:f,mediaKeyMessageError:h}}Object.defineProperty(c,"__esModule",{value:!0});var f=a("../../core/EventBus.js"),g=d(f),h=a("../../core/events/Events.js"),i=d(h),j=a("../../core/FactoryMaker.js"),k=d(j),l="mediasource",m="mediakeys",n="manifest",o="SIDX",p="content",q="initialization",r="xlink",s="codec",t="parse",u="nostreams",v="parse";e.__dashjs_factory_name="ErrorHandler";var w=k["default"].getSingletonFactory(e);w.CAPABILITY_ERROR_MEDIASOURCE=l,w.CAPABILITY_ERROR_MEDIAKEYS=m,w.DOWNLOAD_ERROR_ID_MANIFEST=n,w.DOWNLOAD_ERROR_ID_SIDX=o,w.DOWNLOAD_ERROR_ID_CONTENT=p,w.DOWNLOAD_ERROR_ID_INITIALIZATION=q,w.DOWNLOAD_ERROR_ID_XLINK=r,w.MANIFEST_ERROR_ID_CODEC=s,w.MANIFEST_ERROR_ID_PARSE=t,w.MANIFEST_ERROR_ID_NOSTREAMS=u,w.TIMED_TEXT_ERROR_ID_PARSE=v,c["default"]=w,b.exports=c["default"]},{"../../core/EventBus.js":8,"../../core/FactoryMaker.js":9,"../../core/events/Events.js":11}],140:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(){function a(a){return a&&k&&k.boxes&&0!==k.boxes.length?i(k.fetch(a)):null}function b(a){for(var b,c=k.fetchAll(a),d=[],e=0,f=c.length;f>e;e++)b=i(c[e]),b&&d.push(b);return d}function c(a){k=a}function d(){if(!k||!k.boxes||!k.boxes.length)return null;var a=k.boxes[k.boxes.length-1].type,c=b(a);return c[c.length-1]}function e(){return k._cursor.offset}function f(){l={offset:"_offset",size:"size",type:"type"},m={references:"references",timescale:"timescale",earliest_presentation_time:"earliest_presentation_time",first_offset:"first_offset"},n={reference_type:"reference_type",referenced_size:"referenced_size",subsegment_duration:"subsegment_duration"},o={id:"id",value:"value",timescale:"timescale",scheme_id_uri:"scheme_id_uri",presentation_time_delta:"presentation_time_delta",event_duration:"event_duration",message_data:"message_data"},p={timescale:"timescale"},q={sequence_number:"sequence_number"},r={base_data_offset:"base_data_offset",sample_description_index:"sample_description_index",default_sample_duration:"default_sample_duration",default_sample_size:"default_sample_size",default_sample_flags:"default_sample_flags",flags:"flags"},s={version:"version",baseMediaDecodeTime:"baseMediaDecodeTime",flags:"flags"},t={sample_count:"sample_count",first_sample_flags:"first_sample_flags",data_offset:"data_offset",flags:"flags",samples:"samples"},u={sample_size:"sample_size",sample_duration:"sample_duration",sample_composition_time_offset:"sample_composition_time_offset"}}function h(a,b,c){for(var d in c)b[d]=a[c[d]]}function i(a){if(!a)return null;var b,c,d=new g["default"];switch(h(a,d,l),a.hasOwnProperty("_incomplete")&&(d.isComplete=!a._incomplete),d.type){case"sidx":if(h(a,d,m),d.references)for(b=0,c=d.references.length;c>b;b++)h(a.references[b],d.references[b],n);break;case"emsg":h(a,d,o);break;case"mdhd":h(a,d,p);break;case"mfhd":h(a,d,q);break;case"tfhd":h(a,d,r);break;case"tfdt":h(a,d,s);break;case"trun":if(h(a,d,t),d.samples)for(b=0,c=d.samples.length;c>b;b++)h(a.samples[b],d.samples[b],u)}return d}var j=void 0,k=void 0,l=void 0,m=void 0,n=void 0,o=void 0,p=void 0,q=void 0,r=void 0,s=void 0,t=void 0,u=void 0;return j={getBox:a,getBoxes:b,setData:c,getLastBox:d,getOffset:e},f(),j}Object.defineProperty(c,"__esModule",{value:!0});var f=a("../vo/IsoBox.js"),g=d(f),h=a("../../core/FactoryMaker.js"),i=d(h);e.__dashjs_factory_name="IsoFile",c["default"]=i["default"].getClassFactory(e),b.exports=c["default"]},{"../../core/FactoryMaker.js":9,"../vo/IsoBox.js":152}],141:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(){function a(a,b){n=a,p=b,s=!1,t=NaN,v=null,q=(0,o["default"])(h).getInstance(),w=g["default"].BEST_GUESS_RULES,j.on(m["default"].STREAM_INITIALIZED,f,this)}function b(){s=!1,t=NaN}function c(){return v}function d(){j.off(m["default"].STREAM_INITIALIZED,f,this),b(),v=null,n=null,p=null,s=!1,t=NaN,w=null,q=null}function e(a){var b=((new Date).getTime()-t)/1e3;v=a.value,j.trigger(m["default"].LIVE_EDGE_SEARCH_COMPLETED,{liveEdge:v,searchTime:b,error:null===v?new i["default"](r,"live edge has not been found",null):null})}function f(a){!p.isDynamic()||s||a.error||(w=n.isTimeSyncCompleted()?g["default"].TIME_SYNCHRONIZED_RULES:g["default"].BEST_GUESS_RULES,u=(0,g["default"])(h).getInstance().getRules(w),s=!0,t=(new Date).getTime(),q.applyRules(u,p,e,null,function(a,b){return b}))}var h=this.context,j=(0,k["default"])(h).getInstance(),l=void 0,n=void 0,p=void 0,q=void 0,s=void 0,t=void 0,u=void 0,v=void 0,w=void 0;return l={initialize:a,abortSearch:b,getLiveEdge:c,reset:d}}Object.defineProperty(c,"__esModule",{value:!0});var f=a("../rules/synchronization/SynchronizationRulesCollection.js"),g=d(f),h=a("../vo/Error.js"),i=d(h),j=a("../../core/EventBus.js"),k=d(j),l=a("../../core/events/Events.js"),m=d(l),n=a("../rules/RulesController.js"),o=d(n),p=a("../../core/FactoryMaker.js"),q=d(p),r=1;e.__dashjs_factory_name="LiveEdgeFinder";var s=q["default"].getSingletonFactory(e);s.LIVE_EDGE_NOT_FOUND_ERROR_CODE=r,c["default"]=s,b.exports=c["default"]},{"../../core/EventBus.js":8,"../../core/FactoryMaker.js":9,"../../core/events/Events.js":11,"../rules/RulesController.js":118,"../rules/synchronization/SynchronizationRulesCollection.js":133,"../vo/Error.js":149}],142:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(){function a(a,b){return JSON.stringify(a)===JSON.stringify(b)}var b=void 0;return b={areSimpleEquivalent:a}}Object.defineProperty(c,"__esModule",{value:!0});var f=a("../../core/FactoryMaker.js"),g=d(f);e.__dashjs_factory_name="ObjectUtils",c["default"]=g["default"].getSingletonFactory(e),b.exports=c["default"]},{"../../core/FactoryMaker.js":9}],143:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(){function a(a){return a}function b(a){return a}var c=void 0;return c={modifyRequestURL:a,modifyRequestHeader:b}}Object.defineProperty(c,"__esModule",{value:!0});var f=a("../../core/FactoryMaker.js"),g=d(f);e.__dashjs_factory_name="RequestModifier",c["default"]=g["default"].getSingletonFactory(e),b.exports=c["default"]},{"../../core/FactoryMaker.js":9}],144:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(){function a(a){a&&a.videoModel&&(V=a.videoModel)}function b(a,b,c){var g=void 0,h=void 0,k=void 0,l=void 0,m="",p=new i["default"]([],"",!1);if(G=p.xml_str2json(a),!G)throw"TTML document could not be parsed";V.getTTMLRenderingDiv()&&(l="html");var q=e(G,"http://www.w3.org/ns/ttml");if(q&&f(G,q),g=G.tt,!g)throw"TTML document lacks tt element";if(h=g.head,!h)throw"TTML document lacks head element";if(h.layout&&(I=h.layout.region_asArray),h.styling&&(H=h.styling.style_asArray),k=g.body,!k)throw"TTML document lacks body element";var r=w(),s=V.getElement().clientWidth,u=V.getElement().clientHeight,v=[s/r[0],u/r[1]];N["font-size"]=v[1]+"px;";var B=[];if(I)for(var C=0;Cp||k>c)return void D("TTML: Cue interval "+k+"-"+p+" outside sample interval "+b+"-"+c+". Dropped");var q=!1,t=k,w=p;b>k&&(q=!0,k=b),p>c&&(q=!0,p=c),q&&D("TTML: Clipped cue "+t+"-"+w+" to "+k+"-"+p)}if(void 0!==e["smpte:backgroundImage"])for(var C=G.tt.head.metadata.image_asArray,E=0;E0)return F;throw m}function c(){F=/^([0-9][0-9]+):([0-5][0-9]):([0-5][0-9])|(60)(\.([0-9])+)?$/,J={},K={},L={},M={top:"85%;",left:"5%;",width:"90%;",height:"10%;","align-items":"flex-start;",overflow:"visible;","-ms-writing-mode":"lr-tb, horizontal-tb;","-webkit-writing-mode":"horizontal-tb;","-moz-writing-mode":"horizontal-tb;","writing-mode":"horizontal-tb;"},N={color:"rgb(255,255,255);",direction:"ltr;","font-family":"monospace, sans-serif;","font-style":"normal;","line-height":"normal;","font-weight":"normal;","text-align":"start;","justify-content":"flex-start;","text-decoration":"none;","unicode-bidi":"normal;","white-space":"normal;",width:"100%;"},O={monospace:"font-family: monospace;",sansSerif:"font-family: sans-serif;",serif:"font-family: serif;",monospaceSansSerif:"font-family: monospace, sans-serif;",monospaceSerif:"font-family: monospace, serif;",proportionalSansSerif:"font-family: Arial;",proportionalSerif:"font-family: Times New Roman;","default":"font-family: monospace, sans-serif;"},P={right:["justify-content: flex-end;","text-align: right;"],start:["justify-content: flex-start;","text-align: start;"],center:["justify-content: center;","text-align: center;"],end:["justify-content: flex-end;","text-align: end;"],left:["justify-content: flex-start;","text-align: left;"]},Q={start:"text-align: start;",center:"text-align: center;",end:"text-align: end;",auto:""},R={wrap:"white-space: normal;",noWrap:"white-space: nowrap;"},S={normal:"unicode-bidi: normal;",embed:"unicode-bidi: embed;",bidiOverride:"unicode-bidi: bidi-override;"},T={before:"align-items: flex-start;",center:"align-items: center;",after:"align-items: flex-end;"},U={lrtb:"-webkit-writing-mode: horizontal-tb;writing-mode: horizontal-tb;",rltb:"-webkit-writing-mode: horizontal-tb;writing-mode: horizontal-tb;direction: rtl;unicode-bidi: bidi-override;",tbrl:"-webkit-writing-mode: vertical-rl;writing-mode: vertical-rl;-webkit-text-orientation: upright;text-orientation: upright;",tblr:"-webkit-writing-mode: vertical-lr;writing-mode: vertical-lr;-webkit-text-orientation: upright;text-orientation: upright;",lr:"-webkit-writing-mode: horizontal-tb;writing-mode: horizontal-tb;",rl:"-webkit-writing-mode: horizontal-tb;writing-mode: horizontal-tb;direction: rtl;",tb:"-webkit-writing-mode: vertical-rl;writing-mode: vertical-rl;-webkit-text-orientation: upright;text-orientation: upright;"}}function d(a){var b,c,d,e=F.test(a);if(!e)return NaN;if(b=a.split(":"),c=parseFloat(b[0])*l+parseFloat(b[1])*m+parseFloat(b[2]),b[3]){if(d=G.tt.frameRate,!d||isNaN(d))return NaN;c+=parseFloat(b[3])/d}return c}function e(a,b){var c=Object.keys(a).filter(function(c){return("xmlns"===c.split(":")[0]||"xmlns"===c.split(":")[1])&&a[c]===b}).map(function(a){return a.split(":")[2]||a.split(":")[1]});return 1!=c.length?null:c[0]}function f(a,b){for(var c in a)if(a.hasOwnProperty(c)){if(("object"==typeof a[c]||a[c]instanceof Object)&&!Array.isArray(a[c]))f(a[c],b);else if(Array.isArray(a[c]))for(var d=0;d-1)return!0;return!1}function n(a,b){for(var c=0;c-1)return b[c];return null}function o(a,b){b.splice(b.indexOf(n(a,b)),1)}function p(a,b){for(var c=0;c-1&&a.splice(c,1);return a.concat(b)}function q(a,b){var c=[];for(var d in a)if(a.hasOwnProperty(d)){var e=d.replace("ebutts:","");e=e.replace("xml:",""),e=e.replace("tts:",""),e=g(e),a[e]=a[d],delete a[d]}if("line-padding"in a){var f=parseFloat(a["line-padding"].slice(a["line-padding"].indexOf(":")+1,a["line-padding"].indexOf("c")));"id"in a&&(L[a.id]=f);var i=f*b[0]+"px;";c.push("padding-left:"+i),c.push("padding-right:"+i)}if("font-size"in a){var k=parseFloat(a["font-size"].slice(a["font-size"].indexOf(":")+1,a["font-size"].indexOf("%")));"id"in a&&(J[a.id]=k);var l=k/100*b[1]+"px;";c.push("font-size:"+l)}if("line-height"in a)if("normal"===a["line-height"])c.push("line-height: normal;");else{var m=parseFloat(a["line-height"].slice(a["line-height"].indexOf(":")+1,a["line-height"].indexOf("%")));"id"in a&&(K[a.id]=m);var n=m/100*b[1]+"px;";c.push("line-height:"+n)}"font-family"in a&&(a["font-family"]in O?c.push(O[a["font-family"]]):c.push("font-family:"+a["font-family"]+";")),"text-align"in a&&a["text-align"]in P&&(c.push(P[a["text-align"]][0]),c.push(P[a["text-align"]][1])),"multi-row-align"in a&&(j("text-align",c)&&"auto"!=a["multi-row-align"]&&o("text-align",c),a["multi-row-align"]in Q&&c.push(Q[a["multi-row-align"]]));var p;return"background-color"in a&&(a["background-color"].indexOf("#")>-1&&a["background-color"].length-1===8?(p=h(a["background-color"]),c.push("background-color: "+p)):c.push("background-color:"+a["background-color"]+";")),"color"in a&&(a.color.indexOf("#")>-1&&a.color.length-1===8?(p=h(a.color),c.push("color: "+p)):c.push("color:"+a.color+";")),"wrap-option"in a&&(a["wrap-option"]in R?c.push(R[a["wrap-option"]]):c.push("white-space:"+a["wrap-option"])),"unicode-bidi"in a&&(a["unicode-bidi"]in S?c.push(S[a["unicode-bidi"]]):c.push("unicode-bidi:"+a["unicode-bidi"])),"font-style"in a&&c.push("font-style:"+a["font-style"]+";"),"font-weight"in a&&c.push("font-weight:"+a["font-weight"]+";"),"direction"in a&&c.push("direction:"+a.direction+";"),"text-decoration"in a&&c.push("text-decoration:"+a["text-decoration"]+";"),G.tt.hasOwnProperty("xml:space")&&"preserve"===G.tt["xml:space"]&&c.push("white-space: pre;"),c}function r(a,b){for(var c=0;cd;d++)f+=i[d].outerHTML,0===d&&(c=e.concat(i[d].style.cssText));f=p+c+'">'+f}for(var j="",k=a+1;k'+g,f&&g&&b===l.length-1?h+=f+m+o+g+m:f&&g&&b!==l.length-1?h+=f+m+o+g+m+o:f&&!g?h+=f+m:!f&&g&&b===l.length-1?h+=g+m:!f&&g&&b!==l.length-1&&(h+=g+m+o)});else{for(var q="",r=0;r'+a.innerHTML+m}return h}function y(a,b){var c=document.createElement("div");return a.forEach(function(a){if(!a.hasOwnProperty("metadata"))if(a.hasOwnProperty("span")){var d=a.span.__children,e=document.createElement("span");if(a.span.hasOwnProperty("style")){var f=s(a.span.style,b);e.className="spanPadding "+a.span.style,e.style.cssText=f.join(" ")}d.forEach(function(a){if(!d.hasOwnProperty("metadata"))if(a.hasOwnProperty("#text")){var b=document.createTextNode(a["#text"]);e.appendChild(b)}else if("br"in a){e.hasChildNodes()&&c.appendChild(e);var f=document.createElement("br");f.className="lineBreak",c.appendChild(f);var g=document.createElement("span");g.className=e.className,g.style.cssText=e.style.cssText,e=g}}),c.appendChild(e)}else if(a.hasOwnProperty("br")){var g=document.createElement("br");g.className="lineBreak",c.appendChild(g)}else if(a.hasOwnProperty("#text")){var h=document.createElement("span");h.textContent=a["#text"],c.appendChild(h)}}),c}function z(a,b,c){var d,e,f=[],g=a.region,h=b.region;return h&&(d=v(h,c)),g?(e=f.concat(v(g,c)),f=d?p(d,e):e):d&&(f=d),B(f,M),f}function A(a,b){var c,d,e,f=[],g=a.style,h=G.tt.body.style,i=G.tt.body.div.style,j="";return h&&(c=s(h,b),j="paragraph "+h),i&&(d=s(i,b),c?(d=p(c,d),j+=" "+i):j="paragraph "+i),g?(e=s(g,b),c&&d?(f=p(d,e),j+=" "+g):c?(f=p(c,e),j+=" "+g):d?(f=p(d,e),j+=" "+g):(f=e,j="paragraph "+g)):c&&!d?f=c:!c&&d&&(f=d),B(f,N),[f,j]}function B(a,b){for(var c in b)b.hasOwnProperty(c)&&(j(c,a)||a.push(c+":"+b[c]))}var C=this.context,D=(0,k["default"])(C).getInstance().log,E=void 0,F=void 0,G=void 0,H=void 0,I=void 0,J=void 0,K=void 0,L=void 0,M=void 0,N=void 0,O=void 0,P=void 0,Q=void 0,R=void 0,S=void 0,T=void 0,U=void 0,V=void 0;return E={parse:b,setConfig:a},c(),E}Object.defineProperty(c,"__esModule",{value:!0});var f=a("../../core/FactoryMaker.js"),g=d(f),h=a("../../../externals/xml2json.js"),i=d(h),j=a("../../core/Debug.js"),k=d(j),l=3600,m=60;e.__dashjs_factory_name="TTMLParser",c["default"]=g["default"].getSingletonFactory(e),b.exports=c["default"]},{"../../../externals/xml2json.js":4,"../../core/Debug.js":7,"../../core/FactoryMaker.js":9}],145:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(){function a(a){var b="";return-1!==a.indexOf("/")&&(-1!==a.indexOf("?")&&(a=a.substring(0,a.indexOf("?"))),b=a.substring(0,a.lastIndexOf("/")+1)),b}function b(a){return!d.test(a)}var c=void 0,d=/^(?:(?:[a-z]+:)?\/)?\//i;return c={parseBaseUrl:a,isRelative:b}}Object.defineProperty(c,"__esModule",{value:!0});var f=a("../../core/FactoryMaker.js"),g=d(f);e.__dashjs_factory_name="URLUtils",c["default"]=g["default"].getSingletonFactory(e),b.exports=c["default"]},{"../../core/FactoryMaker.js":9}],146:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(){function a(){k=/(?:\r\n|\r|\n)/gm,l=/-->/,m=/(^[\s]+|[\s]+$)/g,n=/\s\b/g}function b(a){var b,e,g=[];a=a.split(k),b=a.length,e=-1;for(var i=0;b>i;i++){var j=a[i];if(j.length>0&&"WEBVTT"!==j&&j.match(l)){var n=d(j),o=n.cuePoints,p=n.styles,q=f(a,i+1),r=c(o[0].replace(m,"")),s=c(o[1].replace(m,""));!isNaN(r)&&!isNaN(s)&&r>=e&&s>r?""!==q?(e=r,g.push({start:r,end:s,data:q,styles:p})):h("Skipping cue due to empty/malformed cue text"):h("Skipping cue due to incorrect cue timing")}}return g}function c(a){var b=a.split(":"),c=b.length-1;return a=60*parseInt(b[c-1],10)+parseFloat(b[c]),2===c&&(a+=3600*parseInt(b[0],10)),a}function d(a){var b=a.split(l),c=b[1].split(n);return c.shift(),b[1]=c[0],c.shift(),{cuePoints:b,styles:e(c)}}function e(a){var b={};return a.forEach(function(a){if(a.split(/:/).length>1){var c=a.split(/:/)[1];c&&-1!=c.search(/%/)&&(c=parseInt(c.replace(/%/,""),10)),(a.match(/align/)||a.match(/A/))&&(b.align=c),(a.match(/line/)||a.match(/L/))&&(b.line=c),(a.match(/position/)||a.match(/P/))&&(b.position=c),(a.match(/size/)||a.match(/S/))&&(b.size=c)}}),b}function f(a,b){for(var c,d=b,e="",f="";""!==a[d]&&d1)for(var g=0;c>g;g++){if(f=a[b+g],f.match(l)){e="";break}e+=f,g!==c-1&&(e+="\n")}else f=a[b],f.match(l)||(e=f);return decodeURI(e)}var g=this.context,h=(0,i["default"])(g).getInstance().log,j=void 0,k=void 0,l=void 0,m=void 0,n=void 0;return j={parse:b},a(),j}Object.defineProperty(c,"__esModule",{value:!0});var f=a("../../core/FactoryMaker.js"),g=d(f),h=a("../../core/Debug.js"),i=d(h);e.__dashjs_factory_name="VTTParser",c["default"]=g["default"].getSingletonFactory(e),b.exports=c["default"]},{"../../core/Debug.js":7,"../../core/FactoryMaker.js":9}],147:[function(a,b,c){"use strict";function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(c,"__esModule",{value:!0});var e=function f(){d(this,f),this.mediaType=null,this.bitrate=null,this.width=null,this.height=null,this.qualityIndex=NaN};c["default"]=e,b.exports=c["default"]},{}],148:[function(a,b,c){"use strict";function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(c,"__esModule",{value:!0});var e=function f(){d(this,f),this.streamId=null,this.mediaInfo=null,this.segmentType=null,this.quality=NaN,this.index=NaN,this.bytes=null,this.start=NaN,this.end=NaN,this.duration=NaN};c["default"]=e,b.exports=c["default"]},{}],149:[function(a,b,c){"use strict";function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(c,"__esModule",{value:!0});var e=function f(a,b,c){d(this,f),this.code=a||null,this.message=b||null,this.data=c||null};c["default"]=e,b.exports=c["default"]},{}],150:[function(a,b,c){"use strict";function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(c,"__esModule",{value:!0});var e=function f(){d(this,f),this.action=f.ACTION_DOWNLOAD,this.startTime=NaN,this.mediaType=null,this.mediaInfo=null,this.type=null,this.duration=NaN,this.timescale=NaN,this.range=null,this.url=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"};e.ACTION_DOWNLOAD="download",e.ACTION_COMPLETE="complete",c["default"]=e,b.exports=c["default"]},{}],151:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function f(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}Object.defineProperty(c,"__esModule",{value:!0});var g=function(a,b,c){for(var d=!0;d;){var e=a,f=b,g=c;d=!1,null===e&&(e=Function.prototype);var h=Object.getOwnPropertyDescriptor(e,f);if(void 0!==h){if("value"in h)return h.value;var i=h.get;if(void 0===i)return;return i.call(g)}var j=Object.getPrototypeOf(e);if(null===j)return;a=j,b=f,c=g,d=!0,h=j=void 0}},h=a("./FragmentRequest.js"),i=d(h),j=function(a){function b(a){e(this,b),g(Object.getPrototypeOf(b.prototype),"constructor",this).call(this),this.url=a||null,this.checkForExistenceOnly=!0}return f(b,a),b}(i["default"]);c["default"]=j,b.exports=c["default"]},{"./FragmentRequest.js":150}],152:[function(a,b,c){"use strict";function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(c,"__esModule",{value:!0});var e=function f(){d(this,f),this.offset=NaN,this.type=null,this.size=NaN,this.isComplete=!0};c["default"]=e,b.exports=c["default"]},{}],153:[function(a,b,c){"use strict";function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(c,"__esModule",{value:!0});var e=function f(){d(this,f),this.DVRWindowSize=NaN,this.loadedTime=null,this.availableFrom=null,this.minBufferTime=NaN,this.duration=NaN,this.isDynamic=!1,this.maxFragmentDuration=null};c["default"]=e,b.exports=c["default"]},{}],154:[function(a,b,c){"use strict";function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(c,"__esModule",{value:!0});var e=function f(){d(this,f),this.id=null,this.index=null,this.type=null,this.streamInfo=null,this.representationCount=0,this.lang=null,this.viewpoint=null,this.accessibility=null,this.audioChannelConfiguration=null,this.roles=null,this.codec=null,this.mimeType=null,this.contentProtection=null,this.isText=!1,this.KID=null,this.bitrateList=null};c["default"]=e,b.exports=c["default"]},{}],155:[function(a,b,c){"use strict";function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(c,"__esModule",{value:!0});var e=function f(){d(this,f),this.TcpList=[],this.HttpList=[],this.RepSwitchList=[],this.BufferLevel=[],this.BufferState=[],this.PlayList=[],this.DroppedFrames=[],this.SchedulingInfo=[],this.DVRInfo=[],this.ManifestUpdate=[],this.RequestsQueue=null,this.DVBErrors=[],this.BolaState=[]};c["default"]=e,b.exports=c["default"]},{}],156:[function(a,b,c){"use strict";function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(c,"__esModule",{value:!0});var e=function f(){d(this,f),this.id=null,this.index=null,this.start=NaN,this.duration=NaN,this.manifestInfo=null,this.isLast=!0,this.isFirst=!0};c["default"]=e,b.exports=c["default"]},{}],157:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function f(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}Object.defineProperty(c,"__esModule",{value:!0});var g=function(a,b,c){for(var d=!0;d;){var e=a,f=b,g=c;d=!1,null===e&&(e=Function.prototype);var h=Object.getOwnPropertyDescriptor(e,f);if(void 0!==h){if("value"in h)return h.value;var i=h.get;if(void 0===i)return;return i.call(g)}var j=Object.getPrototypeOf(e);if(null===j)return;a=j,b=f,c=g,d=!0,h=j=void 0}},h=a("./FragmentRequest.js"),i=d(h),j=function(a){function b(a,c){e(this,b),g(Object.getPrototypeOf(b.prototype),"constructor",this).call(this),this.url=a||null,this.type=c||null,this.mediaType="stream",this.responseType="text"}return f(b,a),b}(i["default"]);c["default"]=j,b.exports=c["default"]},{"./FragmentRequest.js":150}],158:[function(a,b,c){"use strict";function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(c,"__esModule",{value:!0});var e=function f(){d(this,f),this.video=null,this.captionData=null,this.label=null,this.lang=null,this.defaultTrack=!1,this.kind=null,this.isFragmented=!1,this.isEmbedded=!1};c["default"]=e,b.exports=c["default"]},{}],159:[function(a,b,c){"use strict";function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(c,"__esModule",{value:!0});var e=function f(){d(this,f),this.id=null,this.quality=null,this.DVRWindow=null,this.fragmentDuration=null,this.mediaInfo=null,this.MSETimeOffset=null};c["default"]=e,b.exports=c["default"]},{}],160:[function(a,b,c){"use strict";function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(c,"__esModule",{value:!0});var e=function f(){d(this,f),this.t=null,this.xywh=null,this.track=null,this.id=null,this.s=null};c["default"]=e,b.exports=c["default"]},{}],161:[function(a,b,c){"use strict";function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(c,"__esModule",{value:!0});var e=function f(){d(this,f),this._s=void 0};c["default"]=e,b.exports=c["default"]},{}],162:[function(a,b,c){"use strict";function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(c,"__esModule",{value:!0});var e=function f(){d(this,f),this.t=null,this.level=null};c["default"]=e,b.exports=c["default"]},{}],163:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(c,"__esModule",{value:!0});var f=a("../../controllers/BufferController.js"),g=d(f),h=function i(){e(this,i),this.target=null,this.state=g["default"].BUFFER_EMPTY};c["default"]=h,b.exports=c["default"]},{"../../controllers/BufferController.js":52}],164:[function(a,b,c){"use strict";function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(c,"__esModule",{value:!0});var e=function f(){d(this,f),this.time=null,this.range=null,this.manifestInfo=null};c["default"]=e,b.exports=c["default"]},{}],165:[function(a,b,c){"use strict";function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(c,"__esModule",{value:!0});var e=function f(){d(this,f),this.time=null,this.droppedFrames=null};c["default"]=e,b.exports=c["default"]},{}],166:[function(a,b,c){"use strict";function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(c,"__esModule",{value:!0});var e=function f(){d(this,f),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._responseHeaders=null,this._serviceLocation=null};e.Trace=function(){function a(){d(this,a),this.s=null,this.d=null,this.b=[]}return a}(),e.MPD_TYPE="MPD",e.XLINK_EXPANSION_TYPE="XLinkExpansion",e.INIT_SEGMENT_TYPE="InitializationSegment",e.INDEX_SEGMENT_TYPE="IndexSegment",e.MEDIA_SEGMENT_TYPE="MediaSegment",e.BITSTREAM_SWITCHING_SEGMENT_TYPE="BitstreamSwitchingSegment",e.OTHER_TYPE="other",c["default"]=e,b.exports=c["default"]},{}],167:[function(a,b,c){"use strict";function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(c,"__esModule",{value:!0});var e=function f(){d(this,f),this.mediaType=null,this.type=null,this.requestTime=null,this.fetchTime=null,this.availabilityStartTime=null,this.presentationStartTime=0,this.clientTimeOffset=0,this.currentTime=null,this.buffered=null,this.latency=0,this.streamInfo=[],this.trackInfo=[]};e.StreamInfo=function(){function a(){d(this,a),this.id=null,this.index=null,this.start=null,this.duration=null}return a}(),e.TrackInfo=function(){function a(){d(this,a),this.id=null,this.index=null,this.mediaType=null,this.streamIndex=null,this.presentationTimeOffset=null,this.startNumber=null,this.fragmentInfoType=null}return a}(),c["default"]=e,b.exports=c["default"]},{}],168:[function(a,b,c){"use strict";function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(c,"__esModule",{value:!0});var e=function f(){d(this,f),this.start=null,this.mstart=null,this.starttype=null,this.trace=[]};e.Trace=function(){function a(){d(this,a),this.representationid=null,this.subreplevel=null,this.start=null,this.mstart=null,this.duration=null,this.playbackspeed=null,this.stopreason=null}return a}(),e.INITIAL_PLAYOUT_START_REASON="initial_playout",e.SEEK_START_REASON="seek",e.RESUME_FROM_PAUSE_START_REASON="resume",e.METRICS_COLLECTION_START_REASON="metrics_collection_start",e.Trace.REPRESENTATION_SWITCH_STOP_REASON="representation_switch",e.Trace.REBUFFERING_REASON="rebuffering",e.Trace.USER_REQUEST_STOP_REASON="user_request",e.Trace.END_OF_PERIOD_STOP_REASON="end_of_period",e.Trace.END_OF_CONTENT_STOP_REASON="end_of_content",e.Trace.METRICS_COLLECTION_STOP_REASON="metrics_collection_end",e.Trace.FAILURE_STOP_REASON="failure",c["default"]=e,b.exports=c["default"]},{}],169:[function(a,b,c){"use strict";function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(c,"__esModule",{value:!0});var e=function f(){d(this,f),this.t=null,this.mt=null,this.to=null,this.lto=null};c["default"]=e,b.exports=c["default"]},{}],170:[function(a,b,c){"use strict";function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(c,"__esModule",{value:!0});var e=function f(){d(this,f),this.loadingRequests=[],this.executedRequests=[]};c["default"]=e,b.exports=c["default"]},{}],171:[function(a,b,c){"use strict";function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(c,"__esModule",{value:!0});var e=function f(){d(this,f),this.mediaType=null,this.t=null,this.type=null,this.startTime=null,this.availabilityStartTime=null,this.duration=null,this.quality=null,this.range=null,this.state=null};c["default"]=e,b.exports=c["default"]},{}],172:[function(a,b,c){"use strict";function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(c,"__esModule",{value:!0});var e=function f(){d(this,f),this.tcpid=null,this.dest=null,this.topen=null,this.tclose=null,this.tconnect=null};c["default"]=e,b.exports=c["default"]},{}]},{},[5]); diff --git a/config/settings.yml b/config/settings.yml index 18fc97b4e..034f88909 100644 --- a/config/settings.yml +++ b/config/settings.yml @@ -10,6 +10,12 @@ squash_disable: <%= (Rails.env.development? || Rails.env.test?) %> geo_external_url: 'https://earthworks.stanford.edu/catalog/stanford-' geo_wms_url: 'https://geowebservices.stanford.edu/geoserver/wms/' was_thumbs_url: 'https://thumbnail-service-example' -streaming_url_suffixes: - hls: '.m3u8' - dash: '.mpd' +streaming: + source_types: + - hls + hls: + suffix: '.m3u8' + mimetype: 'application/x-mpegURL' + dash: + suffix: '.mpd' + mimetype: 'application/dash+xml' diff --git a/lib/embed/media_tag.rb b/lib/embed/media_tag.rb index 8509f069f..5dfbf6b40 100644 --- a/lib/embed/media_tag.rb +++ b/lib/embed/media_tag.rb @@ -1,11 +1,9 @@ module Embed - # Utility class to handle generating HTML media tags + # Utility class to handle generating HTML