/* Azure Media Player v2.3.6 | (c) 2016 Microsoft Corporation */ function ObjectIron(a){var b;for(b=[],i=0,len=a.length;ie;e+=1)g=a[e],b.hasOwnProperty(g.name)&&(d.hasOwnProperty(g.name)?g.merge&&(h=b[g.name],i=d[g.name],"object"==typeof h&&"object"==typeof i?c(h,i):d[g.name]=null!=g.mergeFunction?g.mergeFunction(h,i):h+i):d[g.name]=b[g.name])},e=function(a,b){var c,f,g,h,i,j,k,l=a;if(null!==l.children&&0!==l.children.length)for(c=0,f=l.children.length;f>c;c+=1)if(j=l.children[c],b.hasOwnProperty(j.name))if(j.isArray)for(i=b[j.name+"_asArray"],g=0,h=i.length;h>g;g+=1)k=i[g],d(l.properties,b,k),e(j,k);else k=b[j.name],d(l.properties,b,k),e(j,k)},f=function(c){var d,g,h,i,j,k,l;if(null===c)return c;if("object"!=typeof c)return c;for(d=0,g=b.length;g>d;d+=1)"root"===b[d]&&(j=a[d],k=c,e(j,k));for(i in c)if(c.hasOwnProperty(i)){if(h=b.indexOf(i),-1!==h)if(j=a[h],j.isArray)for(l=c[i+"_asArray"],d=0,g=l.length;g>d;d+=1)k=l[d],e(j,k);else k=c[i],e(j,k);f(c[i])}return c};return{run:f}}function X2JS(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=f.childNodes,o=0;ow;w++){var y=a[w];y.test.call(this,s.value)&&(v=y.converter.call(this,s.value),i[b+s.name+y.suffix()]=v,v=null)}v&&(i[b+s.name]=v)}var z=e(f);return null!=z&&""!=z&&(i.__cnt++,i.__prefix=z),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;if(window.DOMParser){var c=new window.DOMParser;b=c.parseFromString(a,"text/xml")}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 this.xml2json(b)},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}}var AzureHtml5JS;!function(a){!function(a){"use strict";function b(a,b){k(a,3,b)}function c(a,b){k(a,2,b)}function d(a,b){k(a,1,b)}function e(a){n=a}function f(a){void 0===a||null===a?o.forEach(function(a,b,c){c[b]=!0}):o[a]=!0}function g(a){void 0===a||null===a?o.forEach(function(a,b,c){c[b]=!1}):o[a]=!1}function h(a){"undefined"==typeof a&&(a=!0),q=a}function i(a){"undefined"==typeof a&&(a=!0);var b=r;return a&&(r=""),b}function j(a,b){s=a,t=b}function k(a,b,c){if(s&&n>=b)return void s(t,b,m[a]+": "+c);var d=new Date(Date.now());if(n>=b&&o[a]){var e="["+d.getHours()+":"+d.getMinutes()+":"+(d.getSeconds()+d.getMilliseconds()/1e3).toFixed(3)+"] "+l[b]+": "+m[a]+": "+c;q&&(r+="\n"+e)}}!function(a){a[a.none=0]="none",a[a.error=1]="error",a[a.warning=2]="warning",a[a.verbose=3]="verbose"}(a.Level||(a.Level={}));var l=a.Level;!function(a){a[a.workflowSequencer=0]="workflowSequencer",a[a.workflowCoordinator=1]="workflowCoordinator",a[a.htmlAdapter=2]="htmlAdapter",a[a.videoElementAdapter=3]="videoElementAdapter",a[a.manifestParser=4]="manifestParser",a[a.httpDataRetriever=5]="httpDataRetriever",a[a.dashUrlFormatter=6]="dashUrlFormatter",a[a.azureHTML5=7]="azureHTML5",a[a.heuristics=8]="heuristics",a[a.segmentLocator=9]="segmentLocator",a[a.mediaParser=10]="mediaParser",a[a.mp4Parser=11]="mp4Parser",a[a.encrypted=12]="encrypted",a[a.common=13]="common",a[a.functionalTest=14]="functionalTest",a[a.ad=15]="ad",a[a.ttml=16]="ttml",a[a.context=17]="context",a[a.max=18]="max"}(a.Area||(a.Area={}));var m=a.Area;a.verbose=b,a.warning=c,a.error=d,a.setConsoleOutputByLevel=e,a.enableConsoleOutputByArea=f,a.disableConsoleOutputByArea=g,a.enableMemoryLog=h,a.getMemoryLog=i,a.setLoggerFunction=j;for(var n=0,o=[],p=0;18>p;p++)o.push(!1);var q=!1,r="",s=void 0,t=null;a.enableConsoleOutputByArea(),a.setConsoleOutputByLevel(1)}(a.Log||(a.Log={}));a.Log}(AzureHtml5JS||(AzureHtml5JS={})),Dash=function(){"use strict";return{modules:{},dependencies:{},vo:{},di:{}}}(),Dash.dependencies.DashParser=function(){"use strict";var a=31536e3,b=2592e3,c=86400,d=3600,e=60,f=60,g=1e3,h=/^P(([\d.]*)Y)?(([\d.]*)M)?(([\d.]*)D)?T?(([\d.]*)H)?(([\d.]*)M)?(([\d.]*)S)?/,i=/^([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}))?/,j=/^[-+]?[0-9]+[.]?[0-9]*([eE][-+]?[0-9]+)?$/,k=[{type:"duration",test:function(a){return h.test(a)},converter:function(f){var g=h.exec(f),i=parseFloat(g[2]||0)*a+parseFloat(g[4]||0)*b+parseFloat(g[6]||0)*c+parseFloat(g[8]||0)*d+parseFloat(g[10]||0)*e+parseFloat(g[12]||0);return i=parseFloat(i.toFixed(9))},suffix:function(){return""}},{type:"datetime",test:function(a){return i.test(a)},converter:function(a){var b,c=i.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])*g||0),c[9]&&c[10]){var d=parseInt(c[9],10)*f+parseInt(c[10],10);b+=("+"===c[8]?-1:1)*d*e*g}return new Date(b)},suffix:function(){return""}},{type:"numeric",test:function(a){return j.test(a)},converter:function(a){return parseFloat(a)},suffix:function(){return""}},{type:"numeric",test:function(a){return j.test(a)},converter:function(a){return a},suffix:function(){return"_str"}}],l=function(){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},m=function(){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},n=function(){var a,b,c,d,e;return e=[{name:"BaseURL",merge:!0,mergeFunction:function(a,b){var c;return c=0===b.indexOf("http://")?b:a+b}}],a={},a.name="mpd",a.isRoot=!0,a.isArray=!0,a.parent=null,a.children=[],a.properties=e,b={},b.name="Period",b.isRoot=!1,b.isArray=!0,b.parent=null,b.children=[],b.properties=e,a.children.push(b),c={},c.name="AdaptationSet",c.isRoot=!1,c.isArray=!0,c.parent=b,c.children=[],c.properties=e,b.children.push(c),d={},d.name="Representation",d.isRoot=!1,d.isArray=!0,d.parent=c,d.children=[],d.properties=e,c.children.push(d),a},o=function(){var a=[];return a.push(l()),a.push(m()),a.push(n()),a},p=function(a,b){var c,d=new X2JS(k,"",!0),e=new ObjectIron(o()),f=new Date,g=null,h=null;try{c=d.xml_str2json(a),g=new Date,c.hasOwnProperty("BaseURL")?(c.BaseURL=c.BaseURL_asArray[0],0!==c.BaseURL.toString().indexOf("http")&&(c.BaseURL=b+c.BaseURL)):c.BaseURL=b,e.run(c),h=new Date,this.debug.log("Parsing complete: ( xml2json: "+(g.getTime()-f.getTime())+"ms, objectiron: "+(h.getTime()-g.getTime())+"ms, total: "+(h.getTime()-f.getTime())/1e3+"s)")}catch(i){return this.errHandler.manifestError("parsing the manifest failed","parse",a),null}return c};return{debug:void 0,errHandler:void 0,parse:p}},Dash.dependencies.DashParser.prototype={constructor:Dash.dependencies.DashParser},function(){function a(a){function b(a){if(this.data="",this.read=0,"string"==typeof a)this.data=a;else if(c.isArrayBuffer(a)||c.isArrayBufferView(a)){var d=new Uint8Array(a);try{this.data=String.fromCharCode.apply(null,d)}catch(e){for(var f=0;fd&&(this.data.substr(0,1),this._constructedStringLength=0)},c.ByteStringBuffer.prototype.length=function(){return this.data.length-this.read},c.ByteStringBuffer.prototype.isEmpty=function(){return this.length()<=0},c.ByteStringBuffer.prototype.putByte=function(a){return this.putBytes(String.fromCharCode(a))},c.ByteStringBuffer.prototype.fillWithByte=function(a,b){a=String.fromCharCode(a);for(var c=this.data;b>0;)1&b&&(c+=a),b>>>=1,b>0&&(a+=a);return this.data=c,this._optimizeConstructedString(b),this},c.ByteStringBuffer.prototype.putBytes=function(a){return this.data+=a,this._optimizeConstructedString(a.length),this},c.ByteStringBuffer.prototype.putString=function(a){return this.putBytes(c.encodeUtf8(a))},c.ByteStringBuffer.prototype.putInt16=function(a){return this.putBytes(String.fromCharCode(a>>8&255)+String.fromCharCode(255&a))},c.ByteStringBuffer.prototype.putInt24=function(a){return this.putBytes(String.fromCharCode(a>>16&255)+String.fromCharCode(a>>8&255)+String.fromCharCode(255&a))},c.ByteStringBuffer.prototype.putInt32=function(a){return this.putBytes(String.fromCharCode(a>>24&255)+String.fromCharCode(a>>16&255)+String.fromCharCode(a>>8&255)+String.fromCharCode(255&a))},c.ByteStringBuffer.prototype.putInt16Le=function(a){return this.putBytes(String.fromCharCode(255&a)+String.fromCharCode(a>>8&255))},c.ByteStringBuffer.prototype.putInt24Le=function(a){return this.putBytes(String.fromCharCode(255&a)+String.fromCharCode(a>>8&255)+String.fromCharCode(a>>16&255))},c.ByteStringBuffer.prototype.putInt32Le=function(a){return this.putBytes(String.fromCharCode(255&a)+String.fromCharCode(a>>8&255)+String.fromCharCode(a>>16&255)+String.fromCharCode(a>>24&255))},c.ByteStringBuffer.prototype.putInt=function(a,b){var c="";do b-=8,c+=String.fromCharCode(a>>b&255);while(b>0);return this.putBytes(c)},c.ByteStringBuffer.prototype.putSignedInt=function(a,b){return 0>a&&(a+=2<0);return b},c.ByteStringBuffer.prototype.getSignedInt=function(a){var b=this.getInt(a),c=2<=c&&(b-=c<<1),b},c.ByteStringBuffer.prototype.getBytes=function(a){var b;return a?(a=Math.min(this.length(),a),b=this.data.slice(this.read,this.read+a),this.read+=a):0===a?b="":(b=0===this.read?this.data:this.data.slice(this.read),this.clear()),b},c.ByteStringBuffer.prototype.bytes=function(a){return"undefined"==typeof a?this.data.slice(this.read):this.data.slice(this.read,this.read+a)},c.ByteStringBuffer.prototype.at=function(a){return this.data.charCodeAt(this.read+a)},c.ByteStringBuffer.prototype.setAt=function(a,b){return this.data=this.data.substr(0,this.read+a)+String.fromCharCode(b)+this.data.substr(this.read+a+1),this},c.ByteStringBuffer.prototype.last=function(){return this.data.charCodeAt(this.data.length-1)},c.ByteStringBuffer.prototype.copy=function(){var a=c.createBuffer(this.data);return a.read=this.read,a},c.ByteStringBuffer.prototype.compact=function(){return this.read>0&&(this.data=this.data.slice(this.read),this.read=0),this},c.ByteStringBuffer.prototype.clear=function(){return this.data="",this.read=0,this},c.ByteStringBuffer.prototype.truncate=function(a){var b=Math.max(0,this.length()-a);return this.data=this.data.substr(this.read,b),this.read=0,this},c.ByteStringBuffer.prototype.toHex=function(){for(var a="",b=this.read;bc&&(a+="0"),a+=c.toString(16)}return a},c.ByteStringBuffer.prototype.toString=function(){return c.decodeUtf8(this.bytes())},c.createBuffer=function(a,b){return b=b||"raw",void 0!==a&&"utf8"===b&&(a=c.encodeUtf8(a)),new c.ByteBuffer(a)},c.encodeUtf8=function(a){return unescape(encodeURIComponent(a))},c.decodeUtf8=function(a){return decodeURIComponent(escape(a))}}return"undefined"==typeof forge&&(forge={}),a(forge)}(),function(){function a(a){a.cipher=a.cipher||{},a.cipher.algorithms=a.cipher.algorithms||{},a.cipher.createDecipher=function(b,c){var d=b;if("string"==typeof d&&(d=a.cipher.getAlgorithm(d),d&&(d=d())),!d)throw new Error("Unsupported algorithm: "+b);return new a.cipher.BlockCipher({algorithm:d,key:c,decrypt:!0})},a.cipher.registerAlgorithm=function(b,c){b=b.toUpperCase(),a.cipher.algorithms[b]=c},a.cipher.getAlgorithm=function(b){return b=b.toUpperCase(),b in a.cipher.algorithms?a.cipher.algorithms[b]:null};var b=a.cipher.BlockCipher=function(a){this.algorithm=a.algorithm,this.mode=this.algorithm.mode,this.blockSize=this.mode.blockSize,this._finish=!1,this._input=null,this.output=null,this._op=a.decrypt?this.mode.decrypt:this.mode.encrypt,this._decrypt=a.decrypt,this.algorithm.initialize(a)};b.prototype.start=function(b){b=b||{};var c={};for(var d in b)c[d]=b[d];c.decrypt=this._decrypt,this._finish=!1,this._input=a.util.createBuffer(),this.output=b.output||a.util.createBuffer(),this.mode.start(c)},b.prototype.update=function(a){for(a&&this._input.putBuffer(a);!this._op.call(this.mode,this._input,this.output,this._finish)&&!this._finish;);this._input.compact()},b.prototype.finish=function(a){!a||"ECB"!==this.mode.name&&"CBC"!==this.mode.name||(this.mode.pad=function(b){return a(this.blockSize,b,!1)},this.mode.unpad=function(b){return a(this.blockSize,b,!0)});var b={};return b.decrypt=this._decrypt,b.overflow=this._input.length()%this.blockSize,this._decrypt||!this.mode.pad||this.mode.pad(this._input,b)?(this._finish=!0,this.update(),this._decrypt&&this.mode.unpad&&!this.mode.unpad(this.output,b)?!1:this.mode.afterFinish&&!this.mode.afterFinish(this.output,b)?!1:!0):!1}}return"undefined"==typeof forge&&(forge={}),a(forge)}(),function(){function a(a){function b(b){if("string"==typeof b&&(b=a.util.createBuffer(b)),a.util.isArray(b)&&b.length>4){var c=b;b=a.util.createBuffer();for(var d=0;d0))return!0;for(var d=0;d0))return!0;for(var d=0;d0)return!1;var c=a.length(),d=a.at(c-1);return d>this.blockSize<<2?!1:(a.truncate(d),!0)}}return"undefined"==typeof forge&&(forge={}),a(forge)}(),function(){function a(a){function b(b,c){var d=function(){return new a.aes.Algorithm(b,c)};a.cipher.registerAlgorithm(b,d)}function c(){k=!0,h=[0,1,2,4,8,16,32,64,128,27,54];for(var a=new Array(256),b=0;128>b;++b)a[b]=b<<1,a[b+128]=b+128<<1^283;f=new Array(256),g=new Array(256),i=new Array(4),j=new Array(4);for(var b=0;4>b;++b)i[b]=new Array(256),j[b]=new Array(256);for(var c,d,e,l,m,n,o,p=0,q=0,b=0;256>b;++b){l=q^q<<1^q<<2^q<<3^q<<4,l=l>>8^255&l^99,f[p]=l,g[l]=p,m=a[l],c=a[p],d=a[c],e=a[d],n=m<<24^l<<16^l<<8^(l^m),o=(c^d^e)<<24^(p^e)<<16^(p^d^e)<<8^(p^c^e);for(var r=0;4>r;++r)i[r][p]=n,j[r][l]=o,n=n<<24|n>>>8,o=o<<24|o>>>8;0===p?p=q=1:(p=c^a[a[a[c^e]]],q^=a[a[q]])}}function d(a,b){for(var c,d=a.slice(0),e=1,g=d.length,i=g+6+1,k=l*i,m=g;k>m;++m)c=d[m-1],m%g===0?(c=f[c>>>16&255]<<24^f[c>>>8&255]<<16^f[255&c]<<8^f[c>>>24]^h[e]<<24,e++):g>6&&m%g===4&&(c=f[c>>>24]<<24^f[c>>>16&255]<<16^f[c>>>8&255]<<8^f[255&c]),d[m]=d[m-g]^c;if(b){var n,o=j[0],p=j[1],q=j[2],r=j[3],s=d.slice(0);k=d.length;for(var m=0,t=k-l;k>m;m+=l,t-=l)if(0===m||m===k-l)s[m]=d[t],s[m+1]=d[t+3],s[m+2]=d[t+2],s[m+3]=d[t+1];else for(var u=0;l>u;++u)n=d[t+u],s[m+(3&-u)]=o[f[n>>>24]]^p[f[n>>>16&255]]^q[f[n>>>8&255]]^r[f[255&n]];d=s}return d}function e(a,b,c,d){var e,h,k,l,m,n=a.length/4-1;d?(e=j[0],h=j[1],k=j[2],l=j[3],m=g):(e=i[0],h=i[1],k=i[2],l=i[3],m=f);var o,p,q,r,s,t,u;o=b[0]^a[0],p=b[d?3:1]^a[1],q=b[2]^a[2],r=b[d?1:3]^a[3];for(var v=3,w=1;n>w;++w)s=e[o>>>24]^h[p>>>16&255]^k[q>>>8&255]^l[255&r]^a[++v],t=e[p>>>24]^h[q>>>16&255]^k[r>>>8&255]^l[255&o]^a[++v],u=e[q>>>24]^h[r>>>16&255]^k[o>>>8&255]^l[255&p]^a[++v],r=e[r>>>24]^h[o>>>16&255]^k[p>>>8&255]^l[255&q]^a[++v],o=s,p=t,q=u;c[0]=m[o>>>24]<<24^m[p>>>16&255]<<16^m[q>>>8&255]<<8^m[255&r]^a[++v],c[d?3:1]=m[p>>>24]<<24^m[q>>>16&255]<<16^m[r>>>8&255]<<8^m[255&o]^a[++v],c[2]=m[q>>>24]<<24^m[r>>>16&255]<<16^m[o>>>8&255]<<8^m[255&p]^a[++v],c[d?1:3]=m[r>>>24]<<24^m[o>>>16&255]<<16^m[p>>>8&255]<<8^m[255&q]^a[++v]}a.aes=a.aes||{},a.aes.Algorithm=function(a,b){k||c();var d=this;d.name=a,d.mode=new b({blockSize:16,cipher:{encrypt:function(a,b){return e(d._w,a,b,!1)},decrypt:function(a,b){return e(d._w,a,b,!0)}}}),d._init=!1},a.aes.Algorithm.prototype.initialize=function(b){if(!this._init){var c,e=b.key;if("string"!=typeof e||16!==e.length&&24!==e.length&&32!==e.length){if(a.util.isArray(e)&&(16===e.length||24===e.length||32===e.length)){c=e,e=a.util.createBuffer();for(var f=0;f>>=2;for(var f=0;g>f;++f)e.push(c.getInt32())}}if(!a.util.isArray(e)||4!==e.length&&6!==e.length&&8!==e.length)throw new Error("Invalid key parameter.");var h=this.mode.name,i=-1!==["CFB","OFB","CTR","GCM"].indexOf(h);this._w=d(e,b.decrypt&&!i),this._init=!0}},a.aes._expandKey=function(a,b){return k||c(),d(a,b)},a.aes._updateBlock=e,b("AES-CBC",a.cipher.modes.cbc);var f,g,h,i,j,k=!1,l=4}return"undefined"==typeof forge&&(forge={}),a(forge)}(),!function(){var a,b,c,d;!function(){var e={},f={};a=function(a,b,c){e[a]={deps:b,callback:c}},d=c=b=function(a){function c(b){if("."!==b.charAt(0))return b;for(var c=b.split("/"),d=a.split("/").slice(0,-1),e=0,f=c.length;f>e;e++){var g=c[e];if(".."===g)d.pop();else{if("."===g)continue;d.push(g)}}return d.join("/")}if(d._eak_seen=e,f[a])return f[a];if(f[a]={},!e[a])throw new Error("Could not find module "+a);for(var g,h=e[a],i=h.deps,j=h.callback,k=[],l=0,m=i.length;m>l;l++)k.push("exports"===i[l]?g={}:b(c(i[l])));var n=j.apply(this,k);return f[a]=g||n}}(),a("promise/all",["./utils","exports"],function(a,b){"use strict";function c(a){var b=this;if(!d(a))throw new TypeError("You must pass an array to all.");return new b(function(b,c){function d(a){return function(b){f(a,b)}}function f(a,c){h[a]=c,0===--i&&b(h)}var g,h=[],i=a.length;0===i&&b([]);for(var j=0;jc;++c,++b)this[b]=255&a[c]},Uint8ArrayUtil.TypedArray=function(a){var b;if("number"==typeof a){b=new Array(a);for(var c=0;a>c;++c)b[c]=0}else b=a.slice(0);return b.subarray=Uint8ArrayUtil.subarray,b.buffer=b,b.byteLength=b.length,b.set=Uint8ArrayUtil.set_,"object"==typeof a&&a.buffer&&(b.buffer=a.buffer),b}}(),void 0===window.Uint8Array&&(window.Uint8Array=Uint8ArrayUtil.TypedArray);var AzureHtml5JS;!function(a){"use strict";function b(a,b,c){return new d(a,b,c)}a.CreateAzureHtml5=b,function(a){a[a.internalErrStart=0]="internalErrStart",a[a.internalErrDisposed=0]="internalErrDisposed",a[a.internalErrSegmentNotFound=1]="internalErrSegmentNotFound",a[a.internalErrEnd=1048575]="internalErrEnd"}(a.ErrorCode||(a.ErrorCode={}));var c=(a.ErrorCode,function(){function a(){}return a.exception="exception",a.flushvideo="flushvideo",a.audiocodecchanged="audiocodecchanged",a}());a.InternalEventName=c;var d=function(){function b(b,c,d){this._sessionContext=new a.Context.Session(this,b,c,d),this._playerType=null,this._autoplay=!0,this._type="",this._error=null,this._dispose=!1,this._retryAttempt=!1,this._oldPlaybackRateBeforePlay=null,this._passThroughEventNames=[a.EventName.volumechange,a.EventName.ended,a.EventName.timeupdate,a.EventName.pause,a.EventName.play,a.EventName.playing,a.EventName.seeking,a.EventName.seeked,a.EventName.suspend,a.EventName.loadstart,a.EventName.loadeddata,a.EventName.ratechange],this._conditionalEventNames=[a.EventName.waiting,a.EventName.canplaythrough,a.EventName.error],this._registerVideoTagEvents(!0),this._registerInternalEvents(!0)}return b.prototype.setStaleDataTimeLimit=function(a){this._sessionContext.maxBufferBehindCurrentTimeInSec=a},b.prototype.dispose=function(){this._dispose=!0,this._workflowCoordinator&&(this._workflowCoordinator.dispose(),this._workflowCoordinator=null),this._sessionContext&&(this._registerVideoTagEvents(!1),this._registerInternalEvents(!1),this._sessionContext.dispose(),this._sessionContext=null),this._error=null},Object.defineProperty(b.prototype,"currentVideoStreamList",{get:function(){return this._workflowCoordinator?this._workflowCoordinator.videoStreamList:null},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"currentAudioStreamList",{get:function(){return this._workflowCoordinator?this._workflowCoordinator.audioStreamList:null},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"src",{get:function(){return this._workflowCoordinator?this._workflowCoordinator.src:this._sessionContext.videoTag.src},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"type",{get:function(){return this._type},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"currentTime",{get:function(){return this._workflowCoordinator?this._workflowCoordinator.currentTime:this._sessionContext.videoTag.currentTime},set:function(b){a.Log.verbose(7,"currentTime: "+b+" sec"),this._workflowCoordinator?this._workflowCoordinator.currentTime=b:this._sessionContext.videoTag.currentTime=b; },enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"currentAbsoluteTime",{get:function(){return this._sessionContext.videoTag.currentTime},set:function(b){a.Log.verbose(7,"currentAbsoluteTime: "+b+" sec"),this._workflowCoordinator?this._workflowCoordinator.currentPresentationTime=b:this._sessionContext.videoTag.currentTime=b},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"currentMediaTime",{get:function(){return this._workflowCoordinator?this._workflowCoordinator.currentMediaTime:null},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"presentationTimeOffsetInSec",{get:function(){return this._workflowCoordinator?this._workflowCoordinator.presentationTimeOffsetInSec:null},enumerable:!0,configurable:!0}),b.prototype.presentationTimeFromPercentageOfDvrWindow=function(a){return this._workflowCoordinator?this._workflowCoordinator.presentationTimeFromPercentageOfDvrWindow(a):null},Object.defineProperty(b.prototype,"currentDownloadBitrate",{get:function(){return this._workflowCoordinator?this._workflowCoordinator.downloadBitrate:null},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"currentPlaybackBitrate",{get:function(){return this._workflowCoordinator?this._workflowCoordinator.playbackBitrate:null},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"videoBufferData",{get:function(){return this._workflowCoordinator?this._workflowCoordinator.videoBufferData:null},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"audioBufferData",{get:function(){return this._workflowCoordinator?this._workflowCoordinator.audioBufferData:null},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"volume",{get:function(){return this._sessionContext.videoTag.volume},set:function(b){a.Log.verbose(7,"volume: "+b.toString());var c=b;if(0/0!==b&&void 0!==b&&null!==b){0>b?c=0:b>1&&(c=1);try{this._sessionContext.videoTag.volume=c}catch(d){a.Log.warning(7,"set volume() error: "+d)}}},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"autoplay",{get:function(){return this._autoplay},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"paused",{get:function(){return this._sessionContext.videoTag.paused},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"seeking",{get:function(){return this._sessionContext.videoTag.seeking},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"ended",{get:function(){return this._sessionContext.videoTag.ended},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"height",{get:function(){return this._sessionContext.videoTag.height},set:function(a){this._sessionContext.videoTag.height=a},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"width",{get:function(){return this._sessionContext.videoTag.width},set:function(a){this._sessionContext.videoTag.width=a},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"videoHeight",{get:function(){return this._sessionContext.videoTag.videoHeight},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"videoWidth",{get:function(){return this._sessionContext.videoTag.videoWidth},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"isFullScreen",{get:function(){var a=document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement;return a===this._sessionContext.videoTag?document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled:!1},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"isLive",{get:function(){return!!this._sessionContext.commonPresentation&&this._sessionContext.commonPresentation.isLive},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"duration",{get:function(){return this._workflowCoordinator?this._workflowCoordinator.duration:this._sessionContext.videoTag.duration},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"buffered",{get:function(){if(this._workflowCoordinator)return this._workflowCoordinator.buffered;try{return this._sessionContext.videoTag.buffered}catch(b){return a.Log.warning(7,"buffered() error: "+b),new a.Common.TimeRangeSet}},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"manifestPlayableWindowLength",{get:function(){return this._sessionContext&&this._sessionContext.commonPresentation&&this._sessionContext.commonPresentation.isLive?this._sessionContext.commonPresentation.timeShiftBufferDepth:void 0},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"currentPlayableWindow",{get:function(){return this._sessionContext&&this._sessionContext.commonPresentation&&this._sessionContext.commonPresentation.isLive?new a.Common.TimeRange(this._sessionContext.commonPresentation.playableWindow.startInSec,this._sessionContext.commonPresentation.playableWindow.endInSec):void 0},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"playableWindowEndInSec",{get:function(){return this._sessionContext&&this._sessionContext.commonPresentation&&this._sessionContext.commonPresentation.playableWindow?this._sessionContext.commonPresentation.playableWindow.endInSec:void 0},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"segmentBoundaries",{get:function(){return this._sessionContext&&this._sessionContext.commonPresentation?this._sessionContext.commonPresentation.segmentBoundaries:void 0},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"error",{get:function(){return this._workflowCoordinator&&this._workflowCoordinator.error?this._workflowCoordinator.error:this._error},enumerable:!0,configurable:!0}),b.prototype.getWallClockTime=function(a,b,c,d,e){a=a||this.currentAbsoluteTime,b=b||!1,c=c||0,e=e||!1,(null===d||void 0===d)&&(d=!0);var f=null;if(this._sessionContext.commonPresentation){var g=this._sessionContext.commonPresentation.getWallClockTimeAtPresentationTime(a);if(g){var h=null;if(b===!0)h=this.getDetailsFromDateObject(g,"local",d,e);else{if(0!==c){var i=36e5*c;g=new Date(g.getTime()+i)}h=this.getDetailsFromDateObject(g,"utc",d,e)}if(!h||h.length<7)return null;var j=h[0],k=h[1],l=h[2],m=h[3],n=h[4],o=h[5],p=h[6];f=e?m+":"+n+":"+o+" "+p:b===!1&&0===c?j+"-"+k+"-"+l+"T"+m+":"+n+":"+o+"Z":j+"-"+k+"-"+l+"T"+m+":"+n+":"+o+this.getTimezoneTimeOffset(g,b,c)}}return f},b.prototype.getTimezoneTimeOffset=function(a,b,c){var d=b===!0?-1*a.getTimezoneOffset()/60:c,e=d%1*60;d=Math.floor(d);var f=Math.abs(d)>=10?Math.abs(d).toString():"0"+Math.abs(d).toString(),g=0===e?":00":":"+e.toString();return d>=0?"+"+f+g:"-"+f+g},b.prototype.getDetailsFromDateObject=function(a,b,c,d){if("utc"!==b&&"local"!==b)return null;var e={year:a.getUTCFullYear,month:a.getUTCMonth,day:a.getUTCDate,hours:a.getUTCHours,minutes:a.getUTCMinutes,seconds:a.getUTCSeconds},f={year:a.getFullYear,month:a.getMonth,day:a.getDate,hours:a.getHours,minutes:a.getMinutes,seconds:a.getSeconds},g={utc:e,local:f},h=g[b].year.call(a).toString(),i=(g[b].month.call(a)+1).toString();i=1==i.length?"0"+i:i;var j=g[b].day.call(a).toString();j=1==j.length?"0"+j:j;var k=g[b].hours.call(a).toString();k=1==k.length?"0"+k:k;var l=g[b].minutes.call(a).toString();l=1==l.length?"0"+l:l;var m=g[b].seconds.call(a).toString();m=1==m.length?"0"+m:m;var n="";if(c&&d){var o=parseInt(k);n=12>o?"AM":"PM",k=((o+11)%12+1).toString()}return[h,i,j,k,l,m,n]},b.prototype.canPlayType=function(b){return a.PlayerType.getByPresentationType(b,this._sessionContext.videoTag)?"maybe":""},b.prototype.setSrc=function(a,b){this.setSrcInternal(a,b,!1)},b.prototype.setSrcInternal=function(c,d,e){this._playStarted=!1;var f="",g=0;return e?g=b._dtsOffsetToAddForChrome:(this._src=c,this._options=d?d:null,this._retryAttempt=!1),"https:"===window.location.protocol.toLowerCase()&&0===c.toLowerCase().indexOf("http:")?(f="The page was loaded over HTTPS, but the source was set to serve over HTTP. The content must be served over HTTPS. Source URL: "+c+", Page URL: "+window.location.href,a.Log.error(7,f),void this._handleError(new a.Failure.External(1048578,f))):(this._sessionContext.reset(),this._reset(d),this._playerType=a.PlayerType.getByPresentationType(this._type,this._sessionContext.videoTag),this._playerType||(a.Log.verbose(7,"Unable to determine player type by presentation type. Trying the url method..."),this._playerType=a.PlayerType.getByUrl(c,this._sessionContext.videoTag)),a.Log.verbose(7,"src: "+c+" autoplay: "+this._autoplay+" type: "+(this._type&&this._type.length>0?this._type:"unknown")+" player: "+(null===this._playerType?"unknown":a.PlayerDetector.Type[this._playerType])),this._workflowCoordinator&&(this._workflowCoordinator.dispose(),this._workflowCoordinator=null),void(1===this._playerType?(this._sessionContext.videoTag.autoplay=this._autoplay,this._sessionContext.videoTag.src=c):3===this._playerType?(this._workflowCoordinator=a.Workflow.CreateCoordinator(this._sessionContext),this._workflowCoordinator.dtsOffsetToAdd=g,this._sessionContext.videoTag.autoplay=!1,this._workflowCoordinator.autoplay=this._autoplay,this._workflowCoordinator.src=c):(a.Log.error(7,c+" not supported by AzureHtml5 Video Element"),this._handleError(new a.Failure.External(4194307,c)))))},b.prototype.play=function(){a.Log.verbose(7,"play"),this._oldPlaybackRateBeforePlay=this.playbackRate(),this._workflowCoordinator?this._workflowCoordinator.play():this._sessionContext&&this._sessionContext.videoTag&&a.Common.videoTagPlay(this._sessionContext.videoTag)},b.prototype.pause=function(){a.Log.verbose(7,"pause"),this._workflowCoordinator?this._workflowCoordinator.pause():this._sessionContext&&this._sessionContext.videoTag&&this._sessionContext.videoTag.pause()},b.prototype.requestFullscreen=function(){a.Log.verbose(7,"requestFullscreen");var b=!1;if(!this.isFullScreen){var c=this._sessionContext.videoTag;c.requestFullscreen?(b=!0,c.requestFullscreen()):c.msRequestFullscreen?(b=!0,c.msRequestFullscreen()):c.webkitRequestFullscreen?(b=!0,c.webkitRequestFullscreen()):c.mozRequestFullScreen&&(b=!0,c.mozRequestFullScreen()),b&&this._sessionContext.eventMgr.dispatchEvent(a.EventName.fullscreenchange)}},b.prototype.exitFullscreen=function(){a.Log.verbose(7,"exitFullscreen");var b=!1;this.isFullScreen&&(document.exitFullscreen?(b=!0,document.exitFullscreen()):document.webkitExitFullscreen?(b=!0,document.webkitExitFullscreen()):document.mozCancelFullScreen?(b=!0,document.mozCancelFullScreen()):document.msExitFullscreen&&(b=!0,document.msExitFullscreen()),b&&this._sessionContext.eventMgr.dispatchEvent(a.EventName.fullscreenchange))},b.prototype.playbackRate=function(){return this._sessionContext.videoTag.playbackRate},b.prototype.setPlaybackRate=function(a){this._sessionContext.videoTag.playbackRate=a},b.prototype.addEventListener=function(a,b,c){"undefined"==typeof c&&(c=null),this._sessionContext.eventMgr.addHandler(a,b,c)},b.prototype.removeEventListener=function(a,b){this._sessionContext.eventMgr.removeHandler(a,b)},b.prototype.addKeySystem=function(a){return this._sessionContext.emeManager.addKeySystem(a)},b.prototype.setXmlHttpRequestFactory=function(a){this._sessionContext.setXmlHttpRequestFactory(a)},b.prototype.getAdSignalsAndReset=function(){return this._sessionContext.adManager.getAdSignalsAndReset()},b.prototype.restartCheckMediaWorkflowIfNeeded=function(){this._workflowCoordinator.restartCheckMediaWorkflowIfNeeded()},b.prototype._reset=function(a){function b(a){c._dispose||c._handleError(a)}var c=this;this._playerType=null,this._autoplay=!0,this._type="",this._error=null,a&&(this._type=a.type,"autoPlay"in a&&(this._autoplay=a.autoPlay),"authenticationTokens"in a&&(this._sessionContext.authenticationTokens=a.authenticationTokens),a.userConfig&&this._sessionContext.setUserConfig(a.userConfig),a.headers&&this._sessionContext.setRequestedDownloadHeaders(a.headers)),this._sessionContext.emeManager.setup(b,this._sessionContext.authenticationTokens)},b.prototype._registerVideoTagEvents=function(b){function c(b){f._dispose||f._error||(b.type&&(b.type===a.EventName.play||b.type===a.EventName.playing)&&(f._playStarted=!0,null!==f._oldPlaybackRateBeforePlay&&f._oldPlaybackRateBeforePlay!==f.playbackRate()&&(a.Log.verbose(7,"playback rate changed from: "+f._oldPlaybackRateBeforePlay+" to: "+f.playbackRate()+". Restoring the original playback rate!"),f.setPlaybackRate(f._oldPlaybackRateBeforePlay),f._oldPlaybackRateBeforePlay=null)),b.type===a.EventName.timeupdate&&f._workflowCoordinator&&f._workflowCoordinator.pendingPlay?a.Log.verbose(7,"skip dispatching event: "+b.type+" currentTime: "+f._sessionContext.videoTag.currentTime+" since work flow is in pending play state"):(a.Log.verbose(7,"dispatching event: "+b.type+" currentTime: "+f._sessionContext.videoTag.currentTime),f._sessionContext.eventMgr.dispatchEvent(b.type)))}function d(b){if(!f._dispose&&!f._error)if(a.EventName.error===b.type){if(f._sessionContext.videoTag.readyState===HTMLMediaElement.HAVE_NOTHING)return void a.Log.warning(7,"Ignoring video element error since state is HAVE_NOTHING "+a.Failure.mediaErrorToString(f._sessionContext.videoTag.error));var c=new a.Failure.External;c.translateMediaError(f._sessionContext.videoTag.error),f._handleError(c)}else f._workflowCoordinator||(a.Log.verbose(7,"dispatching event: "+b.type),f._sessionContext.eventMgr.dispatchEvent(b.type))}var e=this,f=this;this._passThroughEventNames.forEach(function(a){b?e._sessionContext.videoTag.addEventListener(a,c):e._sessionContext.videoTag.removeEventListener(a,c)}),this._conditionalEventNames.forEach(function(a){b?e._sessionContext.videoTag.addEventListener(a,d):e._sessionContext.videoTag.removeEventListener(a,d)})},b.prototype._registerInternalEvents=function(b){function d(b){function c(){var c,d=b;throw c=d.message&&d.message.message&&d.message.stack?d.message.message+", "+d.message.stack:d.message,a.Log.error(7,"Throwing error "+c),new Error(c)}e._dispose||b.message&&!e._checkErrorAndRetryPlayback()&&a.Util.setTimeout(c,0)}var e=this;b?this._sessionContext.eventMgr.addHandler(c.exception,d,this):this._sessionContext.eventMgr.removeHandler(c.exception,d)},b.prototype._checkErrorAndRetryPlayback=function(){return this._playStarted||!a.Common.isChrome||this._retryAttempt?!1:(a.Log.verbose(7,"Retrying Playback with Adjusted DTS"),this._retryAttempt=!0,this.setSrcInternal(this._src,this._options,!0),!0)},b.prototype._handleError=function(b){if(!(this._checkErrorAndRetryPlayback()||this._workflowCoordinator&&this._workflowCoordinator.error)){if(this._error=b,this._workflowCoordinator){var c=new Error;a.Log.verbose(7,"Disposing WorkflowCoordinator b/c "+b.toString()+", "+c.stack),this._workflowCoordinator.dispose(),this._workflowCoordinator=null}a.Log.verbose(7,"dispatching event: "+a.EventName.error),this._sessionContext.eventMgr.dispatchEvent(a.EventName.error)}},b._dtsOffsetToAddForChrome=.1,b}()}(AzureHtml5JS||(AzureHtml5JS={}));var __extends=this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);c.prototype=b.prototype,a.prototype=new c},AzureHtml5JS;!function(a){!function(b){"use strict";var c=function(){function c(){this._disposed=!1,this._bandwidthTracker=null,this._buffer=null,this._downloadRequested=null,this._downloadCompleted=null,this._downloadDecrypted=null,this._downloadFailed=null,this._downloadTracker=null,this._eventMgr=new a.Events.Manager(null,!1)}return c.prototype.dispose=function(){this._disposed||(this._disposed=!0,this._bandwidthTracker=null,this._buffer=null,this._downloadRequested=null,this._downloadCompleted=null,this._downloadDecrypted=null,this._downloadFailed=null,this._eventMgr&&(this._eventMgr.dispose(),this._eventMgr=null),this._downloadTracker&&(this._downloadTracker.dispose(),this._downloadTracker=null))},Object.defineProperty(c.prototype,"bufferLevel",{get:function(){return this._disposed||!this._buffer?null:this._buffer.getBufferedAheadOfCurrentTimeInSec()},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"perceivedBandwidth",{get:function(){return this._disposed||!this._bandwidthTracker?null:this._bandwidthTracker.perceivedBandwidth()},enumerable:!0,configurable:!0}),c.prototype.updateBuffer=function(a){this._buffer=a},c.prototype.updateBandwidthTracker=function(a){this._bandwidthTracker=a,this._downloadTracker&&this._downloadTracker.dispose(),this._downloadTracker=new b.DownloadTracker},c.prototype.getPlaybackBitrate=function(a){return this._disposed||!this._downloadTracker?-1:this._downloadTracker.findBitrate(a)},Object.defineProperty(c.prototype,"downloadRequested",{get:function(){return this._downloadRequested},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"downloadCompleted",{get:function(){return this._downloadCompleted},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"downloadDecrypted",{get:function(){return this._downloadDecrypted},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"downloadFailed",{get:function(){return this._downloadFailed},enumerable:!0,configurable:!0}),c.prototype.dispatchDownloadRequested=function(b){this._downloadRequested=b,this._eventMgr.dispatchEvent(a.BufferDataEventName.downloadrequested)},c.prototype.dispatchDownloadCompleted=function(b,c,d){if(this._downloadCompleted=new e(b,c,d),this._eventMgr.dispatchEvent(a.BufferDataEventName.downloadcompleted),this._downloadTracker&&null!=b.mediaTime&&(this._downloadTracker.add(b.mediaTime,b.bitrate),this._buffer.buffered&&this._buffer.buffered.length>0)){var f=this._buffer.buffered.start(0);this._downloadTracker.cleanup(f)}},c.prototype.dispatchDownloadDecrypted=function(b){this._downloadDecrypted=b,this._eventMgr.dispatchEvent(a.BufferDataEventName.downloaddecrypted)},c.prototype.dispatchDownloadFailed=function(b,c,d){"undefined"==typeof d&&(d=""),this._downloadFailed=new f(b,c,d),this._eventMgr.dispatchEvent(a.BufferDataEventName.downloadfailed)},c.prototype.addEventListener=function(a,b,c){this._eventMgr.addHandler(a,b,c)},c.prototype.removeEventListener=function(a,b){this._eventMgr.removeHandler(a,b)},c}();b.BufferData=c;var d=function(){function a(a,b,c,d,e,f,g){this._url=a,this._bitrate=b,this._mediaTime=c,this._data=d,this._presentationTimeOffsetInSec=e,this._timeScale=f,this._durationInSec=g}return Object.defineProperty(a.prototype,"url",{get:function(){return this._url},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"bitrate",{get:function(){return this._bitrate},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"mediaTime",{get:function(){return this._mediaTime},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"data",{get:function(){return this._data},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"presentationTimeOffsetInSec",{get:function(){return this._presentationTimeOffsetInSec},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"timeScale",{get:function(){return this._timeScale},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"durationInSec",{get:function(){return this._durationInSec},enumerable:!0,configurable:!0}),a}();b.MediaDownload=d;var e=function(){function a(a,b,c){this._mediaDownload=a,this._measuredBw=1e3*b.bandwidth,this._bytes=b.responseLengthInBytes,this._downloadTimeMs=b.totalDownloadTimeMs,this._responseHeaders=c}return Object.defineProperty(a.prototype,"mediaDownload",{get:function(){return this._mediaDownload},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"measuredBandwidth",{get:function(){return this._measuredBw},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"totalBytes",{get:function(){return this._bytes},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"totalDownloadMs",{get:function(){return this._downloadTimeMs},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"responseHeaders",{get:function(){return this._responseHeaders},enumerable:!0,configurable:!0}),a}();b.MediaDownloadCompleted=e;var f=function(){function a(a,b,c){this._mediaDownload=a,this._code=b,this._message=c}return Object.defineProperty(a.prototype,"code",{get:function(){return this._code},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"message",{get:function(){return this._message},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"mediaDownload",{get:function(){return this._mediaDownload},enumerable:!0,configurable:!0}),a}();b.MediaDownloadFailed=f;var g=function(a){function b(b,c,d,e,f,g,h,i){a.call(this,b,c,d,e,f,g,h),this._decryptionTimeInMS=i}return __extends(b,a),Object.defineProperty(b.prototype,"decryptionTimeInMS",{get:function(){return this._decryptionTimeInMS},enumerable:!0,configurable:!0}),b}(d);b.MediaDecrypted=g}(a.Context||(a.Context={}));a.Context}(AzureHtml5JS||(AzureHtml5JS={}));var AzureHtml5JS;!function(a){!function(b){"use strict";!function(a){a[a.proceed=0]="proceed",a[a.endOfStream=1]="endOfStream",a[a.retry=2]="retry"}(b.RequestState||(b.RequestState={}));b.RequestState;!function(a){a[a.arraybuffer=0]="arraybuffer",a[a.blob=1]="blob",a[a.document=2]="document",a[a.json=3]="json",a[a.text=4]="text"}(b.ResponseType||(b.ResponseType={}));b.ResponseType;!function(a){a[a.manifest=0]="manifest",a[a.mediaSegment=1]="mediaSegment",a[a.initSegment=2]="initSegment",a[a.initBandwidth=3]="initBandwidth"}(b.RequestType||(b.RequestType={}));var c=(b.RequestType,function(){function c(c,d,e,f){this.maxBufferBehindCurrentTimeInSec=-1,this.azureHtml5=c,this.videoTag=d,this.appConfig=f,this.emeManager=new a.KeySystem.EmeManager(d),this.eventMgr=new a.Events.Manager(c,!1),this.emeManager.setEventManager(this.eventMgr),this.adManager=new a.Ad.Manager(this.eventMgr),this.ttmlManager=new a.Ttml.Manager(e),this.workflows=null,this.presentationUrl=null,this.presentationQueryStr=null,this.presentationJson=null,this.commonPresentation=null,this.isLiveToVod=!1,this.videoBufferData=new b.BufferData,this.audioBufferData=new b.BufferData,this.textBufferData=new b.BufferData,this.startPositionInSec=0/0,this.authenticationTokens={},this.heuristicSettings=new a.Settings.Heuristics,this.httpRetryPolicySettings=new a.Settings.HttpRetryPolicy,this.httpDataRetrieverSettings=new a.Settings.HttpDataRetriever,this.decryptionTracker=new a.Heuristics.DecryptionTracker,this._disposed=!1,this._xmlHttpRequestFactory=null}return c.prototype.dispose=function(){this._disposed||(this._disposed=!0,this.videoTag=null,this.appConfig=null,this.workflows&&this.workflows.forEach(function(a){a.dispose()}),this.workflows=null,this.presentationUrl=null,this.presentationQueryStr=null,this.presentationJson=null,this.authenticationTokens=null,this._xmlHttpRequestFactory=null,this.azureHtml5=null,this.emeManager&&(this.emeManager.dispose(),this.emeManager=null),this.eventMgr&&(this.eventMgr.dispose(),this.eventMgr=null),this.adManager&&(this.adManager=null),this.ttmlManager&&(this.ttmlManager=null),this.commonPresentation&&(this.commonPresentation.dispose(),this.commonPresentation=null),this.heuristicSettings=null,this.decryptionTracker=null,this.videoBufferData&&(this.videoBufferData.dispose(),this.videoBufferData=null),this.audioBufferData&&(this.audioBufferData.dispose(),this.audioBufferData=null),this.textBufferData&&(this.textBufferData.dispose(),this.textBufferData=null))},Object.defineProperty(c.prototype,"disposed",{get:function(){return this._disposed},enumerable:!0,configurable:!0}),c.prototype.reset=function(){this.presentationUrl=null,this.presentationQueryStr=null,this.presentationJson=null,this.startPositionInSec=0/0,this.authenticationTokens={},this.commonPresentation&&(this.commonPresentation.dispose(),this.commonPresentation=null),this.emeManager&&this.emeManager.reset(),this.heuristicSettings&&this.heuristicSettings.reset(),this.videoBufferData&&(this.videoBufferData.dispose(),this.videoBufferData=new b.BufferData),this.audioBufferData&&(this.audioBufferData.dispose(),this.audioBufferData=new b.BufferData),this.textBufferData&&(this.textBufferData.dispose(),this.textBufferData=new b.BufferData),this.adManager&&this.adManager.reset(),this.ttmlManager&&this.ttmlManager.reset()},c.prototype.setRequestedDownloadHeaders=function(a){this.headers=a},c.prototype.setUserConfig=function(a){void 0!==a.maxBufferInWallClockSec&&(this.heuristicSettings.buffer.maxBufferInWallClockSec=a.maxBufferInWallClockSec),void 0!==a.prerollPercent&&(this.heuristicSettings.buffer.prerollPercent=a.prerollPercent),void 0!==a.livePlaybackOffsetPercent&&(this.heuristicSettings.buffer.livePlaybackOffsetPercent=a.livePlaybackOffsetPercent),void 0!==a.windowSizeHeuristicsEnabled&&(this.heuristicSettings.windowSizeHeuristicsEnabled=a.windowSizeHeuristicsEnabled),void 0!==a.useBrowserWindowForWindowSizeRule&&(this.heuristicSettings.useBrowserWindowForWindowSizeRule=a.useBrowserWindowForWindowSizeRule),void 0!==a.minFragmentsForBandwidthAverage&&(this.heuristicSettings.bandwidth.minBandwidthHistoryCount=a.minFragmentsForBandwidthAverage),void 0!==a.bandwidthTestWithTimeThresholdDuringLive&&(this.heuristicSettings.bandwidth.bandwidthTestWithTimeThresholdDuringLive=a.bandwidthTestWithTimeThresholdDuringLive),void 0!==a.useVariableFragmentSizeMode&&(this.heuristicSettings.bandwidth.useVariableFragmentSizeMode=a.useVariableFragmentSizeMode),void 0===a.decryptionTimeHeuristicsEnabled||a.decryptionTimeHeuristicsEnabled||(this.decryptionTracker=null),void 0!==a.preFetchDataEnabled&&(this.heuristicSettings.preFetchDataEnabled=a.preFetchDataEnabled),void 0!==a.maxRetryPerSegment&&(this.httpRetryPolicySettings.maxRetryPerSegment=a.maxRetryPerSegment),void 0!==a.maxSkipSegments&&(this.httpRetryPolicySettings.maxSkipSegments=a.maxSkipSegments),void 0!==a.maxTotalRetries&&(this.httpRetryPolicySettings.maxTotalRetries=a.maxTotalRetries),void 0!==a.infiniteSegmentRetryForPreconditionFailed&&(this.httpRetryPolicySettings.infiniteSegmentRetryForPreconditionFailed=a.infiniteSegmentRetryForPreconditionFailed),void 0!==a.maxRetriesForKeyAcquireFailure&&(this.httpRetryPolicySettings.maxRetriesForKeyAcquireFailure=a.maxRetriesForKeyAcquireFailure),void 0!==a.maxWaitTimeBetweenRetriesForKeyAcquireMS&&(this.httpRetryPolicySettings.maxWaitTimeBetweenRetriesForKeyAcquireMS=a.maxWaitTimeBetweenRetriesForKeyAcquireMS)},c.prototype.maxBufferInWallClockSec=function(){return this.appConfig&&this.appConfig.maxBufferInWallClockSec&&"0"!=this.appConfig.maxBufferInWallClockSec?parseInt(this.appConfig.maxBufferInWallClockSec):this.heuristicSettings.buffer.maxBufferInWallClockSec},c.prototype.maxBufferInSec=function(){return this.maxBufferInWallClockSec()*this.playbackRate()},c.prototype.prerollBufferInSec=function(){return this.maxBufferInSec()*this.heuristicSettings.buffer.prerollPercent},c.prototype.lowBufferInSec=function(){return this.maxBufferInSec()*this.heuristicSettings.vodDowngradeBufferLevelPercent*this.heuristicSettings.buffer.lowBufferPercent},c.prototype.liveStartBufferInSec=function(){return this.maxBufferInSec()*(this.heuristicSettings.buffer.prerollPercent+this.heuristicSettings.buffer.livePlaybackOffsetPercent)},c.prototype.updatePresentation=function(b){if(this.commonPresentation){var c=b.isLive&&null!==b.periods[0].streams.findFirst(function(a){return(0===a.type||1===a.type)&&!a.segments});c?a.Log.verbose(17,"New manifest without segments no presentationUpdate was done."):(this.commonPresentation.isLive&&!b.isLive&&(this.isLiveToVod=!0),this.commonPresentation.transferPresentationState(b),this.presentationJson=b.toJson()),b.dispose()}else this.commonPresentation=b,this.presentationJson=b.toJson()},c.prototype.setXmlHttpRequestFactory=function(a){this._xmlHttpRequestFactory=a},c.prototype.createXmlHttpRequest=function(){return this._xmlHttpRequestFactory?this._xmlHttpRequestFactory():new a.HttpRequest.XMLHttpRequestWrapper},c.prototype.playbackRate=function(){return this.azureHtml5.playbackRate()},c}());b.Session=c;var d=function(){function a(a,b){this.workflowType=a,this.sessionContext=b,this.state=0,this.retryWaitTimeMSec=0,this.currentModuleId=null,this.requestedStream=null,this.urlsToRetrieve=[],this.selectedTrack=null,this.selectedSegment=null,this.heuristicData=null,this.externalFailure=null,this.failTracker=new h,this._disposed=!1}return a.prototype.dispose=function(){this._disposed||(this._disposed=!0,this.workflowType=null,this.sessionContext=null,this.state=null,this.currentModuleId=null,this.requestedStream=null,this.urlsToRetrieve.forEach(function(a,b,c){c[b].dispose()}),this.urlsToRetrieve=[],this.selectedTrack=null,this.selectedSegment=null,this.heuristicData&&(this.heuristicData.dispose(),this.heuristicData=null),this.externalFailure&&(this.externalFailure.dispose(),this.externalFailure=null),this.failTracker&&(this.failTracker.dispose(),this.failTracker=null))},a.prototype.reset=function(){this.state=0,this.retryWaitTimeMSec=0,this.currentModuleId=null,this.selectedTrack=null,this.selectedSegment=null,1===this.workflowType&&(this.urlsToRetrieve=[]),this.heuristicData&&this.heuristicData.reset(),this.externalFailure=null},Object.defineProperty(a.prototype,"disposed",{get:function(){return this._disposed},enumerable:!0,configurable:!0}),a}();b.Request=d;var e=function(){function a(a,b,c,d,e,f,g){"undefined"==typeof b&&(b=0),"undefined"==typeof c&&(c=4),"undefined"==typeof d&&(d=""),"undefined"==typeof e&&(e=0/0),"undefined"==typeof f&&(f=0/0),"undefined"==typeof g&&(g=0/0),this.url=a,this.httpResponseCode=-1,this.httpResposeContentType="",this.mediaData=null,this.presentationData=null,this.streamId=d,this.bitrate=e,this.presTimeInSec=f,this.durationInSec=g,this.responseType=c,this.requestType=b}return a.prototype.dispose=function(){this.url=null,this.httpResponseCode=null,this.httpResposeContentType="",this.mediaData=null,this.presentationData=null,this.streamId="",this.bitrate=0/0,this.presTimeInSec=0/0,this.durationInSec=0/0,this.responseType=null},a.prototype.clone=function(){var b=new a(this.url,this.requestType,this.responseType,this.streamId,this.bitrate,this.presTimeInSec,this.durationInSec);return b.httpResponseCode=this.httpResponseCode,b.httpResposeContentType=this.httpResposeContentType,b.mediaData=this.mediaData.slice(0),b.presentationData=this.presentationData,b},a}();b.UrlRequest=e;var f=function(){function a(a){var b=[];a.tracks.forEach(function(a){a.streamingInfo.selectable&&b.push(new g(a))}),this.tracksData=b}return a.prototype.dispose=function(){this.tracksData.forEach(function(a,b,c){c[b].dispose()}),this.tracksData=[]},a.prototype.reset=function(){this.tracksData.forEach(function(a,b,c){c[b].reset()})},a}();b.HeuristicData=f;var g=function(){function a(a){this.trackInfo=a,this.selectable=!0,this.dataRetrieverEstimationInWallClockSec=null}return a.prototype.dispose=function(){this.trackInfo=null,this.selectable=null,this.dataRetrieverEstimationInWallClockSec=null},a.prototype.reset=function(){this.selectable=!0,this.dataRetrieverEstimationInWallClockSec=null},a}();b.TrackData=g;var h=function(){function a(){this.reset()}return a.prototype.dispose=function(){this.lastFailure=null,this.lastTrack=null,this.tracksToTry=[]},a.prototype.reset=function(){this.lastFailure=null,this.lastTrack=null,this.lastStreamType=-1,this.totalRetried=0,this.tracksToTry=[],this.trackToTryIdx=0,this.sameRequestRetried=0,this.segmentsSkipped=0,this.noDataReceivedFailure=!1},a.prototype.resetForSegment=function(){this.sameRequestRetried=0,this.trackToTryIdx=0},a.prototype.log=function(a,b,c){this.lastFailure=a,this.lastTrack=b,this.lastStreamType=c},a.prototype.isNone=function(){return null===this.lastFailure},a.prototype.isLastNetworkFail=function(){return this.lastFailure.code>=2097752&&this.lastFailure.code<3145727},a.prototype.isLastNetworkDown=function(){return 2097753===this.lastFailure.code},a.prototype.isLastNotReady=function(){return 2097564===this.lastFailure.code},a.prototype.isLastServerError=function(){return this.lastFailure.code>=2097652&&this.lastFailure.code<=2097751; },a.prototype.isLastNotFound=function(){return 2097556===this.lastFailure.code},a.prototype.isSegmentDecryptionError=function(){return 5242885===this.lastFailure.code},a}();b.FailTracker=h}(a.Context||(a.Context={}));a.Context}(AzureHtml5JS||(AzureHtml5JS={}));var AzureHtml5JS;!function(a){!function(b){"use strict";var c=function(){function b(){this._downloads=[]}return b.prototype.dispose=function(){this._downloads=[]},b.prototype.add=function(b,c){if(0===this._downloads.length)return void this._downloads.push({time:b,bitrate:c});var d=this._downloads[this._downloads.length-1];if(b>d.time)return void(c!=d.bitrate&&this._downloads.push({time:b,bitrate:c}));var e=a.Common.binarySearchTimeline(b,this._downloads,this._compareTime);(-1===e||b>this._downloads[e].time)&&e++,this._downloads.splice(e,this._downloads.length-e),this._downloads.push({time:b,bitrate:c})},b.prototype.findBitrate=function(b){var c=a.Common.binarySearchTimeline(b,this._downloads,this._compareTime);return-1===c?-1:this._downloads[c].bitrate},b.prototype.cleanup=function(b){if(!(this._downloads.length>0&&b<=this._downloads[0].time)){var c=a.Common.binarySearchTimeline(b,this._downloads,this._compareTime);c>0&&this._downloads.splice(0,c)}},b.prototype._compareTime=function(a,b,c){var d=0;return c?(a=c.time&&(d=1),d):b.time<=a?0:-1},b}();b.DownloadTracker=c}(a.Context||(a.Context={}));a.Context}(AzureHtml5JS||(AzureHtml5JS={}));var AzureHtml5JS;!function(a){!function(b){"use strict";var c=function(){function c(c){var d=this;this._videoElement=c,this._errorHandler=null,this.matchedKeySystem=null,this._audioContentType=null,this._videoContentType=null,this._psshBoxes=[],this._keySystems={},this._laUrls={},this._authenticationTokens={},this._disposed=!1,this._initializedKeySystem=null,this._eventManager=null,this._useEMEv3ForPlayReady="requestMediaKeySystemAccess"in navigator&&a.Common.isChromiumEdge;var e=this._useEMEv3ForPlayReady?new b.PlayReady:new b.PlayReadyLegacy;this.addKeySystem(e);var f=new b.Widevine;this.addKeySystem(f),this._needKeyHandlerWrapper=function(a){d._needKeyHandler(a)},this._encryptedHandlerWrapper=function(a){d._encryptedHandler(a)},this._useEMEv3ForPlayReady||a.EmeUtil.listenToNeedKey(c,this._needKeyHandlerWrapper),a.EmeUtil.listenToEncrypted(c,this._encryptedHandlerWrapper)}return c.prototype.reset=function(){this.matchedKeySystem&&(this.matchedKeySystem.deactivate(),this.matchedKeySystem=null),this._psshBoxes=[],this._laUrls={},this._errorHandler=null,this._audioContentType=null,this._videoContentType=null,this._authenticationTokens={},this._initializedKeySystem=null},c.prototype.dispose=function(){this._disposed||(this._disposed=!0,this.matchedKeySystem&&(this.matchedKeySystem.deactivate(),this.matchedKeySystem=null),a.EmeUtil.unlistenToNeedKey(this._videoElement,this._needKeyHandlerWrapper),a.EmeUtil.unlistenToEncrypted(this._videoElement,this._encryptedHandlerWrapper),this._needKeyHandlerWrapper=null,this._encryptedHandlerWrapper=null,this._psshBoxes=[],this._keySystems={},this._laUrls={},this._videoElement=null,this._errorHandler=null,this._audioContentType=null,this._videoContentType=null,this._authenticationTokens=null,this._initializedKeySystem=null,this._eventManager=null)},c.prototype.setEventManager=function(a){this._eventManager=a},c.prototype.setup=function(a,b){this._errorHandler=a,this._authenticationTokens=b},c.prototype.setContentTypes=function(a,b){this._audioContentType=a,this._videoContentType=b},c.prototype.addKeySystem=function(b){var c=a.Common.uint8ArrayToHexString(b.systemId);return c&&c.length>0?(this._keySystems[c]&&a.Log.warning(12,"Overwriting "+b.name),this._keySystems[c]=b,b):null},c.prototype.addPsshBoxes=function(b){var c=this;b.forEach(function(b){var d=a.Common.uint8ArrayToHexString(b.systemId);a.Log.verbose(12,"Adding pssh box with system ID "+d),c._psshBoxes.push(b)})},c.prototype.addLaUrl=function(b,c){var d=a.Common.uint8ArrayToHexString(b);return this._keySystems[d]?(this._laUrls[d]&&this._laUrls[d]!==c&&a.Log.warning(12,"Overwriting license acquisition URL for "+this._keySystems[d].name),void(this._laUrls[d]=c)):void a.Log.warning(12,"Cannot set license acquisition URL for system ID "+d)},c.prototype._needKeyHandler=function(b){var c=this;if(!this._disposed){if(a.Log.verbose(12,"Got needKey event"),b.initData){var d=new DataView(b.initData.buffer),e=a.Mp4Util.GetPsshBoxes(d);this.addPsshBoxes(e)}this._findMatchedKeySystem().then(function(b){if(!b||null!=c._initializedKeySystem&&c._initializedKeySystem!=b.type)c._reportKeySystemNotFound();else{null==c._initializedKeySystem&&(c._initializedKeySystem=b.type);for(var d=0;d=b._psshBoxes.length)return void d();var g=a.Common.uint8ArrayToHexString(b._psshBoxes[f].systemId);b._keySystems[g]?b._keySystems[g].isSupported(b._psshBoxes[f].systemId,b._audioContentType,b._videoContentType).then(function(){b.matchedKeySystem=b._keySystems[g],b.matchedKeySystem.activate(b._videoElement,b._errorHandler,b._authenticationTokens[b.matchedKeySystem.type]),b._eventManager&&b._eventManager.dispatchEvent("drmselected"),a.Log.verbose(12,"Matched key system found: "+b.matchedKeySystem.name),c(b.matchedKeySystem)},function(){++f,e()}):(++f,e())}if(b.matchedKeySystem)return void c(b.matchedKeySystem);var f=0;e()})},c.prototype._reportKeySystemNotFound=function(){var b=new a.Failure.External(5242881,"no matching keySystem found");this._errorHandler(b)},c}();b.EmeManager=c}(a.KeySystem||(a.KeySystem={}));a.KeySystem}(AzureHtml5JS||(AzureHtml5JS={}));var __extends=this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);c.prototype=b.prototype,a.prototype=new c},AzureHtml5JS;!function(a){!function(b){"use strict";var c=function(){function b(){this.name="com.microsoft.playready",this.type="PlayReady",this._authenticationToken="",this._errorHandler=null,this._videoElement=null,this._active=!1,b.overrideLicenseAcquisitionUrl=a.KeySystem.PlayReady.overrideLicenseAcquisitionUrl}return Object.defineProperty(b.prototype,"systemId",{get:function(){return b.systemId},enumerable:!0,configurable:!0}),b.prototype.isSupported=function(c,d,e){return c.isEqual(b.systemId)?a.EmeUtil.isTypeSupported(this.name,d,e):new Promise(function(a,b){b()})},b.prototype.activate=function(){},b.prototype.deactivate=function(){},b.prototype.initData=function(){},b.prototype._getPlayReadyLicense=function(c,d){var e=this;return new Promise(function(f,g){var h=null,i=[],j=new DOMParser,k=j.parseFromString(c,"application/xml");if(!k.getElementsByTagName("Challenge")[0])return a.Log.error(12,"Playready: Can not find Challenge in keyMessage"),void g(new a.Failure.External(5242886,"No challenge"));var l=k.getElementsByTagName("Challenge")[0].childNodes[0].nodeValue;l&&(h=atob(l));var m=k.getElementsByTagName("name"),n=k.getElementsByTagName("value");if(m.length!=n.length)return a.Log.error(12,"Playready update, invalid header name/value pair in keyMessage"),void g(new a.Failure.External(5242886,"Invalid headers"));for(var o=0;o0&&(i[m.length]={name:a.HttpUtil.authorizationHeader,value:e._authenticationToken}),b.overrideLicenseAcquisitionUrl&&(a.Log.verbose(12,"overriding license acquisition url: "+d+" with: "+b.overrideLicenseAcquisitionUrl),d=b.overrideLicenseAcquisitionUrl),a.HttpUtil.httpRequest(d,"POST","arraybuffer",i,h).then(function(b){a.Log.verbose(12,"Processed license request"),f(new Uint8Array(b))},function(b){var c=new a.Failure.External(5242886,"Http: "+a.Common.toHexString(b.code)+", reponse: "+b.response);g(c)})})},b.prototype._reportError=function(a){this._errorHandler&&this._errorHandler(a)},b.systemId=new Uint8Array([154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149]),b}();b.PlayReadyBase=c;var d=function(b){function d(){b.call(this),this._laUrl="",this._session=null,this._initialized=!1}return __extends(d,b),d.prototype.activate=function(a,b,c){this._videoElement=a,this._errorHandler=b,this._authenticationToken=c,this._active=!0},d.prototype.deactivate=function(){this._active&&(this._active=!1,this._session&&(a.EmeUtil.unlistenToMessage(this._session,this._messageHandler),this._session.close(),this._session=null),this._videoElement&&(this._videoElement.src="",this._videoElement.setMediaKeys(null),this._videoElement=null),this._errorHandler=null,this._laUrl="",this._authenticationToken="",this._initialized=!1)},d.prototype.initData=function(b,d,e,f){function g(a){return a.createMediaKeys()}function h(b){if(a.Log.verbose(12,"creating media key session for PlayReady"),l._session=b.createSession(),!l._session){a.Log.error(12,l.name+" createSession failed");var c=new a.Failure.External(5242881,l.name+" createSession failed");return void l._reportError(c)}a.EmeUtil.listenToMessage(l._session,i),l._session.generateRequest("cenc",d)["catch"](function(){a.Log.error(12,l.name+" generateRequest failed");var b=new a.Failure.External(5242881,l.name+" generateRequest failed");l._reportError(b)}),l._videoElement.setMediaKeys(b)["catch"](function(){a.Log.error(12,l.name+" setMediaKeys failed");var b=new a.Failure.External(5242881,l.name+" setMediaKeys failed");l._reportError(b)})}function i(a){l._messageHandler(a)}function j(b){var c=new window.URL(b);return c&&"https:"!=c.protocol?(a.Log.verbose(12,"Converting url from http to https."),"https:"+c.href.substring(c.protocol.length)):b}function k(){a.Log.verbose(12,"Ensuring license server url uses https."),l._laUrl=j(l._laUrl),c.overrideLicenseAcquisitionUrl&&(a.Log.verbose(12,"Ensuring license server url override uses https."),c.overrideLicenseAcquisitionUrl=j(c.overrideLicenseAcquisitionUrl))}var l=this;if(!this._initialized){this._initialized=!0;for(var m=new DataView(b),n=a.Mp4Util.GetPsshBoxes(m),o=0;of;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},d}(c);b.PlayReady=d;var e=function(b){function c(){b.call(this),this._session=null}return __extends(c,b),c.prototype.activate=function(a,b,c){this._videoElement=a,this._errorHandler=b,this._authenticationToken=c,this._active=!0},c.prototype.deactivate=function(){this._active&&(this._active=!1,this._session&&(a.EmeUtil.unlistenToKeyMessage(this._session,this._keyMessageHandler),a.EmeUtil.unlistenKeyError(this._session,this._keyErrorHandler),this._session.close(),this._session=null),this._videoElement=null,this._errorHandler=null,this._authenticationToken="")},c.prototype.initData=function(b,c,d,e){function f(a){h._keyMessageHandler(a)}function g(){h._keyErrorHandler()}var h=this;if(!this._session){var i=a.EmeUtil.createMediaKeys(this.name);if(!i){a.Log.error(12,this.name+" createMediaKeys failed");var j=new a.Failure.External(5242881,this.name+" createMediaKeys failed");return void this._reportError(j)}a.EmeUtil.setMediaKeys(this._videoElement,i);var k=e.substr(0,e.length-1);if(d){var l=d.substr(d.indexOf("=")+2);k+=", "+l}if(a.Log.verbose(12,"creating media key session for PlayReady"),this._session=i.createSession(k,c),!this._session){a.Log.error(12,this.name+" createSession failed");var j=new a.Failure.External(5242881,this.name+" createSession failed");return void this._reportError(j)}a.EmeUtil.listenToKeyMessage(this._session,f),a.EmeUtil.listenKeyError(this._session,g)}},c.prototype._keyMessageHandler=function(a){var b=this,c=new Uint16Array(a.message.buffer),d=String.fromCharCode.apply(null,c),e=a.destinationURL;this._getPlayReadyLicense(d,e).then(function(a){b._active&&b._session&&b._session.update(a)},function(a){b._active&&b._reportError(a)})},c.prototype._keyErrorHandler=function(){if(this._active&&this._session.error){var b="MSMediaKeyError code: "+this._session.error.code+", systemCode: "+a.Common.toHexString(this._session.error.systemCode),c=new a.Failure.External(5242880,b);this._reportError(c)}},c}(c);b.PlayReadyLegacy=e}(a.KeySystem||(a.KeySystem={}));a.KeySystem}(AzureHtml5JS||(AzureHtml5JS={}));var AzureHtml5JS;!function(a){!function(a){"use strict";var b=function(){function a(){this.windowSizeHeuristicsEnabled=a._windowSizeHeuristicsEnabledDefault,this.useBrowserWindowForWindowSizeRule=a._useBrowserWindowForWindowSizeRuleDefault,this.preFetchDataEnabled=a._preFetchDataEnabledDefault,this.preFetchDataMiddle=a._preFetchDataMiddleDefault,this.vodStableBufferLevelPercent=a._vodStableBufferLevelPercentDefault,this.vodDowngradeBufferLevelPercent=a._vodDowngradeBufferLevelPercentDefault,this.belowDowngradeBufferLevelDownloadTimeFactor=a._belowDowngradeBufferLevelDownloadTimeFactorDefault,this.bandwidth=null,this.stepRule=null,this.buffer=null,this.bandwidth=new c,this.stepRule=new d,this.buffer=new e}return a.prototype.reset=function(){this.windowSizeHeuristicsEnabled=a._windowSizeHeuristicsEnabledDefault,this.useBrowserWindowForWindowSizeRule=a._useBrowserWindowForWindowSizeRuleDefault,this.preFetchDataEnabled=a._preFetchDataEnabledDefault,this.preFetchDataMiddle=a._preFetchDataMiddleDefault,this.vodStableBufferLevelPercent=a._vodStableBufferLevelPercentDefault,this.vodDowngradeBufferLevelPercent=a._vodDowngradeBufferLevelPercentDefault,this.belowDowngradeBufferLevelDownloadTimeFactor=a._belowDowngradeBufferLevelDownloadTimeFactorDefault,this.bandwidth.reset(),this.stepRule.reset(),this.buffer.reset()},a._windowSizeHeuristicsEnabledDefault=!0,a._useBrowserWindowForWindowSizeRuleDefault=!1,a._preFetchDataEnabledDefault=!0,a._preFetchDataMiddleDefault=!0,a._vodStableBufferLevelPercentDefault=.7,a._vodDowngradeBufferLevelPercentDefault=.15,a._belowDowngradeBufferLevelDownloadTimeFactorDefault=.75,a}();a.Heuristics=b;var c=function(){function a(){this.bandwidthUsabilityPercent=a._bandwidthUsabilityPercentDefault,this.bandwidthDataSizeThresholdInBytes=a._bandwidthDataSizeThresholdInBytesDefault,this.bandwidthEstimationMaxKbps=a._bandwidthEstimationMaxKbpsDefault,this.bandwidthEstimationMinMsec=a._bandwidthEstimationMinMsecDefault,this.maxBandwidthHistoryCount=a._maxBandwidthHistoryCountDefault,this.minBandwidthHistoryCount=a._minBandwidthHistoryCountDefault,this.bandwidthTestWithTimeThresholdDuringLive=a._bandwidthTestWithTimeThresholdDuringLiveDefault,this.useVariableFragmentSizeMode=a._useVariableFragmentSizeModeDefault}return a.prototype.reset=function(){this.bandwidthUsabilityPercent=a._bandwidthUsabilityPercentDefault,this.bandwidthDataSizeThresholdInBytes=a._bandwidthDataSizeThresholdInBytesDefault,this.bandwidthEstimationMaxKbps=a._bandwidthEstimationMaxKbpsDefault,this.bandwidthEstimationMinMsec=a._bandwidthEstimationMinMsecDefault,this.maxBandwidthHistoryCount=a._maxBandwidthHistoryCountDefault,this.minBandwidthHistoryCount=a._minBandwidthHistoryCountDefault,this.bandwidthTestWithTimeThresholdDuringLive=a._bandwidthTestWithTimeThresholdDuringLiveDefault,this.useVariableFragmentSizeMode=a._useVariableFragmentSizeModeDefault},a._bandwidthUsabilityPercentDefault=.85,a._bandwidthDataSizeThresholdInBytesDefault=1e4,a._bandwidthEstimationMaxKbpsDefault=5e5,a._bandwidthEstimationMinMsecDefault=5,a._maxBandwidthHistoryCountDefault=5,a._minBandwidthHistoryCountDefault=1,a._bandwidthTestWithTimeThresholdDuringLiveDefault=!0,a._useVariableFragmentSizeModeDefault=!1,a}();a.Bandwidth=c;var d=function(){function a(){this.minSegmentsBeforeDowngrade=a._minSegmentsBeforeDowngradeDefault,this.minSegmentsBeforeUpgrade=a._minSegmentsBeforeUpgradeDefault,this.maxStepDownInQuality=a._maxStepDownInQualityDefault,this.maxStepUpInQuality=a._maxStepUpInQualityDefault}return a.prototype.reset=function(){this.minSegmentsBeforeDowngrade=a._minSegmentsBeforeDowngradeDefault,this.minSegmentsBeforeUpgrade=a._minSegmentsBeforeUpgradeDefault,this.maxStepDownInQuality=a._maxStepDownInQualityDefault,this.maxStepUpInQuality=a._maxStepUpInQualityDefault},a._minSegmentsBeforeDowngradeDefault=0,a._minSegmentsBeforeUpgradeDefault=1,a._maxStepDownInQualityDefault=10,a._maxStepUpInQualityDefault=3,a}();a.StepRule=d;var e=function(){function a(){this.maxBufferInWallClockSec=a._maxBufferInSecDefault,this.prerollPercent=a._prerollPercentDefault,this.livePlaybackOffsetPercent=a._livePlaybackOffsetPercentDefault,this.leftEdgeBackoffInSec=a._leftEdgeBackoffInSecDefault,this.lowBufferPercent=a._lowBufferPercentDefault}return a.prototype.reset=function(){this.maxBufferInWallClockSec=a._maxBufferInSecDefault,this.prerollPercent=a._prerollPercentDefault,this.lowBufferPercent=a._lowBufferPercentDefault,this.livePlaybackOffsetPercent=a._livePlaybackOffsetPercentDefault,this.leftEdgeBackoffInSec=a._leftEdgeBackoffInSecDefault},a._maxBufferInSecDefault=30,a._prerollPercentDefault=.25,a._lowBufferPercentDefault=.25,a._livePlaybackOffsetPercentDefault=.25,a._leftEdgeBackoffInSecDefault=4,a}();a.Buffer=e;var f=function(){function a(){this.maxTotalRetries=a._maxTotalRetriesDefault,this.maxRetryPerSegment=a._maxRetryPerSegmentDefault,this.maxRetryPresentation=a._maxRetryPresentationDefault,this.maxSkipSegments=a._maxSkipSegmentsDefault,this.retryLowerBitrateOnly=!1,this.retryMediaInMSec=a._retryMediaInMSecDefault,this.retryMediaServerErrorInMSec=a._retryMediaServerErrorInMSecDefault,this.retryPresentationInMSec=a._retryPresentationInMSecDefault,this.retryDueToNetworkErrorInMSec=a._retryDueToNetworkErrorInMSecDefault,this.retryDueTo412InTextTrackInMSecDefault=a._retryDueTo412InTextTrackInMSecDefault,this.infiniteSegmentRetryForPreconditionFailed=!1,this.maxRetriesForKeyAcquireFailure=a._maxRetriesForKeyAcquireFailure,this.maxWaitTimeBetweenRetriesForKeyAcquireMS=a._retryInMSecBetweenKeyAcquireFailures}return a._maxTotalRetriesDefault=50,a._maxRetryPerSegmentDefault=10,a._maxRetryPresentationDefault=5,a._maxSkipSegmentsDefault=30,a._retryMediaInMSecDefault=2e3,a._retryMediaServerErrorInMSecDefault=4e3,a._retryPresentationInMSecDefault=500,a._retryDueToNetworkErrorInMSecDefault=1e3,a._retryDueTo412InTextTrackInMSecDefault=500,a._maxRetriesForKeyAcquireFailure=3,a._retryInMSecBetweenKeyAcquireFailures=500,a}();a.HttpRetryPolicy=f;var g=function(){function a(){this.initBandwidthTimeoutInMSec=a._initBandwidthTimeout,this.noDataTimeoutInMSec=a._noDataTimeoutDefault,this.timeoutInMSec=a._minTimeoutInMSecDefault,this.liveEdgeAdjustmentInSec=a._liveEdgeAdjustmentDefaultInSec}return Object.defineProperty(a.prototype,"maxTimeoutInMSec",{get:function(){return 6e4},enumerable:!0,configurable:!0}),a._minTimeoutInMSecDefault=1e4,a._initBandwidthTimeout=1e3,a._noDataTimeoutDefault=1e3,a._liveEdgeAdjustmentDefaultInSec=-1,a}();a.HttpDataRetriever=g}(a.Settings||(a.Settings={}));a.Settings}(AzureHtml5JS||(AzureHtml5JS={}));var AzureHtml5JS;!function(a){!function(b){"use strict";function c(){return new g}function d(){return window.hasOwnProperty("MediaSource")||window.hasOwnProperty("WebKitMediaSource")?!0:!1}b.CreateAdapter=c,b.supported=d;var e={closed:0,open:1,ended:2},f=function(){function a(a,b,c){this.bufferIndex=a,this.startTime=b,this.endTime=c}return a}(),g=function(){function c(){this._mediaSource=new MediaSource,this._sourceOpenHandler=null,this._adapterSourceBuffers=new h,this._disposed=!1,this._videoTag=null,this._buffered=null}return c.prototype.dispose=function(){if(!this._disposed){if(this._mediaSource){for(var a=this._mediaSource.sourceBuffers.length-1;a>=0;a--)this._mediaSource.removeSourceBuffer(this._mediaSource.sourceBuffers[a]);this._sourceOpenHandler&&(this._mediaSource.removeEventListener("sourceopen",this._sourceOpenHandler),this._sourceOpenHandler=null),this._mediaSource=null}this._adapterSourceBuffers.dispose(),this._adapterSourceBuffers=null,this._videoTag&&(this._videoTag.src&&(URL.revokeObjectURL(this._videoTag.src),this._videoTag.src=null),this._videoTag=null),this._disposed=!0}},Object.defineProperty(c.prototype,"readyState",{get:function(){return this._disposed?0:e[this._mediaSource.readyState]},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"durationInSec",{get:function(){return this._disposed?0/0:this._mediaSource.duration},set:function(a){this._disposed||(this._mediaSource.duration=a)},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"adapterBuffers",{get:function(){return this._disposed?null:this._adapterSourceBuffers.adapterBuffers},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"buffered",{get:function(){return this._buffered},enumerable:!0,configurable:!0}),c.prototype.setVideoElementSrcAsync=function(a){var b=this;return this._videoTag=a,new Promise(function(c,d){return b._disposed?void d("VideoElementAdapter already disposed"):(b._sourceOpenHandler=function(){return b._disposed?void d("VideoElementAdapter already disposed"):(b._mediaSource.removeEventListener("sourceopen",b._sourceOpenHandler),b._sourceOpenHandler=null,void c())},b._mediaSource.addEventListener("sourceopen",b._sourceOpenHandler),void(a.src=URL.createObjectURL(b._mediaSource)))})},c.prototype.setStartTime=function(b){function d(){!e._disposed&&e._videoTag&&0===e._videoTag.currentTime&&(e._videoTag.readyState!==HTMLMediaElement.HAVE_NOTHING?(e._videoTag.currentTime=b,a.Log.verbose(3,"StartTime set: "+b)):(a.Log.verbose(3,"Video tag not ready, will retry to set StartTime to "+b),a.Util.setTimeout(d,c._setCurrentTimeTimeoutInMSec)))}var e=this;d()},c.prototype.addAdapterBuffer=function(c,d,e,f,g){function h(){k._updateBuffered()}function i(a){e.call(k,a)}if(this._disposed)return null;var j,k=this,l=null;try{j=this._mediaSource.addSourceBuffer(c),l=new b.VideoElementAdapterBuffer(f,g,d,j,h,i,c),this._adapterSourceBuffers.add(l,j),a.Log.verbose(3,"Adapter buffer added: "+c+" Adapter buffer total: "+this._adapterSourceBuffers.length)}catch(m){a.Log.error(3,"Failed to add SourceBuffer to MediaSource: "+m)}if(null!==l&&null!==j&&"audio"===l.mediaType)try{j.changeType(c),l.hasAudioTypeChangeSupport=!0}catch(n){a.Log.verbose(3,"Adapter buffer added: "+c+" does not support type change: "+n)}return l},c.prototype.isTypeSupported=function(a){return MediaSource.isTypeSupported&&MediaSource.isTypeSupported(a)},c.prototype.removeAdapterBuffer=function(b){if(!this._disposed){var c;c=this._adapterSourceBuffers.find(b),-1!==c?(this._mediaSource.removeSourceBuffer(this._adapterSourceBuffers.sourceBuffers[c]),this._adapterSourceBuffers.remove(c),a.Log.verbose(3,"Adapter buffer removed, remaining: "+this._adapterSourceBuffers.length)):a.Log.error(3,"Failed to remove adapter buffer: instance not found")}},c.prototype.changeAdapterBufferType=function(b,c){if(this._disposed)return!1;var d,e=!1;if(d=this._adapterSourceBuffers.find(b),-1!==d)try{this._adapterSourceBuffers.sourceBuffers[d].updating&&this._adapterSourceBuffers.sourceBuffers[d].abort();var f=this._adapterSourceBuffers.sourceBuffers[d];f.changeType(c),a.Log.verbose(3,"Adapter buffer media type succesfully changed to "+c),e=!0}catch(g){a.Log.error(3,"Failed to change source buffer media type")}else a.Log.error(3,"Failed to find the source buffer to change its media type");return e},c.prototype.endOfStream=function(b){function d(){if(!e._disposed)try{f?e._mediaSource.endOfStream(f):e._mediaSource.endOfStream(),a.Log.verbose(3,"End of stream signaled")}catch(b){if(!(b.code===DOMException.INVALID_STATE_ERR&&g++<10))throw a.Log.error(3,"Failed to set end-of-stream: "+b),b;a.Log.warning(3,"MediaSource not ready, will retry: "+b),a.Util.setTimeout(d,c._retryTimeoutInMSec)}}var e=this,f=b,g=0;d()},c.prototype._updateBuffered=function(){if(!this._disposed){for(var b=this._adapterSourceBuffers.adapterBuffers,c=new a.Common.TimeRangeSet,d=this._findUniqueStartTimes(),e=0;e=0;a--)this.adapterBuffers[a].dispose(),this.adapterBuffers[a]=null;for(var a=this.sourceBuffers.length-1;a>=0;a--)this.sourceBuffers[a]=null},Object.defineProperty(a.prototype,"length",{get:function(){if(this.sourceBuffers.length!==this.adapterBuffers.length)throw new Error("AdapterSourceBuffers in invalid state");return this.sourceBuffers.length},enumerable:!0,configurable:!0}),a.prototype.find=function(a){return this.adapterBuffers.indexOf(a)},a.prototype.add=function(a,b){this.adapterBuffers.push(a),this.sourceBuffers.push(b)},a.prototype.remove=function(a){a>=0&&a0?d.end(d.length-1):0/0;for(var e=0;ethis._maxAdapterBufferAheadInWallClockSec*a},b.prototype.contains=function(a){for(var b=this.buffered,c=0;c=0;a--)this._pendingBuffer[a]=null;this._sourceBuffer=null;for(var a=this._pendingRemove.length-1;a>=0;a--)this._pendingRemove[a]=null;this._submittedRemove&&(this._submittedRemove=null),this._pendingBufferRanges&&(this._pendingBufferRanges.dispose(),this._pendingBufferRanges=null)}},b.prototype.flushBufferBehindCurrentTime=function(){if(this._maxAdapterBufferBehindCurrentTimeInSec>0)try{var b=this._playbackPosFn()-this._maxAdapterBufferBehindCurrentTimeInSec,c=this.getStartTimeOfCurrentBuffered();c!=0/0&&c>=0&&b>c&&this.flushUntil(b)}catch(d){a.Log.warning(3,this._decorateLogMessage("Ignoring Exception in flushBufferBehindCurrentTim")); }},b.prototype.append=function(b,c,d){this.flushBufferBehindCurrentTime();var e,f,g,h;for(h=0;h0){f=this._pendingBuffer[h-1];var i=a.Common.diffTimes(c,f.presTimeInSec+f.durationInSec);if(i>0)throw new Error(this._decorateLogMessage("append ("+c+","+d+") failed, overlaps with ("+f.presTimeInSec+","+f.durationInSec+")"))}if(h0)throw new Error(this._decorateLogMessage("append ("+c+","+d+") failed, overlaps with ("+g.presTimeInSec+","+g.durationInSec+")"))}}e=new a.Common.SegmentData(b,c,d),this._pendingBuffer.splice(h,0,e),this._updatePendingRanges(),a.Log.verbose(3,this._decorateLogMessage("Appending segment: "+c+" sec "+b.byteLength+" bytes")),this._tryInternalAppend(),this._notifyBufferUpdated()},b.prototype.remove=function(b,c){var d;b=Math.max(b,0),d=new a.Common.TimeRange(b,c),this._pendingRemove.push(d),a.Log.verbose(3,this._decorateLogMessage("Added to remove pending list ["+b+","+c+")")),this._tryInternalRemove()},b.prototype.flushFrom=function(a){var b=this._sourceBuffer.buffered;this._sourceBuffer.updating&&this._sourceBuffer.abort();var c=0,d=0;if(b.length>0&&(c=b.start(0)),this._pendingBuffer.length>0&&(c=Math.min(c,this._pendingBuffer[0].presTimeInSec)),this._pendingBuffer.length>0){var e=this._pendingBuffer[this._pendingBuffer.length-1];d=e.presTimeInSec+e.durationInSec}if(b.length>0&&(d=Math.max(d,b.end(b.length-1))),void 0!==a&&(c=a),d>c)this.remove(c,d);else if(0!==c||0!==d)throw new Error(this._decorateLogMessage("flush failed, endTime ("+d+") not greater than startime ("+c+")"))},b.prototype.getStartTimeOfCurrentBuffered=function(){var a=this._sourceBuffer.buffered,b=0/0;return a.length>0&&(b=a.start(0)),this._pendingBuffer.length>0&&(b=Math.min(b,this._pendingBuffer[0].presTimeInSec)),b},b.prototype.flushUntil=function(a){var b=this._sourceBuffer.buffered,c=0,d=0;if(b.length>0&&(c=b.start(0)),this._pendingBuffer.length>0&&(c=Math.min(c,this._pendingBuffer[0].presTimeInSec)),this._pendingBuffer.length>0){var e=this._pendingBuffer[this._pendingBuffer.length-1];d=e.presTimeInSec+e.durationInSec}if(b.length>0&&(d=Math.max(d,b.end(b.length-1))),d=Math.min(d,a),d>c)this.remove(c,d);else if(0!==c||0!==d)throw new Error(this._decorateLogMessage("flush failed, endTime ("+d+") not greater than startime ("+c+")"))},b.prototype._tryInternalAppend=function(){if(this._pendingBuffer&&this._sourceBuffer&&0!==this._pendingBuffer.length&&!this._sourceBuffer.updating)try{this._sourceBuffer.appendBuffer(this._pendingBuffer[0].data),a.Log.verbose(3,this._decorateLogMessage("Appended segment to SourceBuffer: "+this._pendingBuffer[0].presTimeInSec+" sec "+this._pendingBuffer[0].data.byteLength+" bytes")),this._pendingBuffer.splice(0,1),this._updatePendingRanges()}catch(b){switch(b.code){case DOMException.INVALID_STATE_ERR:case DOMException.QUOTA_EXCEEDED_ERR:a.Log.error(3,this._decorateLogMessage("Failed to append segment to SourceBuffer, will retry: "+b)),this._appendErrorHandler&&this._appendErrorHandler(this._sourceBuffer);break;default:throw a.Log.error(3,this._decorateLogMessage("Failed to append segment to SourceBuffer: "+b)),b}}},b.prototype._tryInternalRemove=function(){if(this._sourceBuffer&&(this._sourceBuffer.updating||(this._submittedRemove=null),this._pendingBuffer&&this._pendingRemove))for(;0!==this._pendingRemove.length&&!this._sourceBuffer.updating;){var b;b=this._pendingRemove[0];for(var c=this._pendingBuffer.length-1;c>=0;c--){var d,e,f;d=this._pendingBuffer[c],e=d.presTimeInSec,f=d.durationInSec,e>=b.startInSec&&e0&&i.push({name:b.WidevineCustomAuthorizationHeader||a.HttpUtil.authorizationHeader,value:f._authenticationToken}),c.overrideLicenseAcquisitionUrl&&(a.Log.verbose(12,"overriding license acquisition url: "+e+" with: "+c.overrideLicenseAcquisitionUrl),e=c.overrideLicenseAcquisitionUrl),a.HttpUtil.httpRequest(e,"POST","arraybuffer",i,d).then(function(a){g(new Uint8Array(a))},function(b){var c=new a.Failure.External(5242886,"Http: "+a.Common.toHexString(b.code)+", reponse: "+b.response);h(c)})})},c.prototype._reportError=function(a){this._errorHandler&&this._errorHandler(a)},c.systemId=new Uint8Array([237,239,139,169,121,214,74,206,163,200,39,220,213,29,33,237]),c}();b.Widevine=c,b.WidevineCustomAuthorizationHeader=""}(a.KeySystem||(a.KeySystem={}));a.KeySystem}(AzureHtml5JS||(AzureHtml5JS={}));var AzureHtml5JS;!function(a){!function(b){"use strict";function c(a){return new d(a)}b.CreateCoordinator=c;var d=function(){function c(d){var e=this;this._sessionContext=d,this._workflowSeq=b.CreateSequencer(this._sessionContext),this._mediaSource=null,this._lastPresentation=new Date(0),this._pendingPresentation=new Date,this._disposed=!1,this._pendingPlay=!0,this._pendingTryMediaRequestCount=0,this._prerollMet=!1,this._error=null,this._playbackPosInSec=null,this._pendingPlaybackPosInSec=null,this._seekingForward=!0,this._lastDuration=0,this._videoStreamList=null,this._audioStreamList=null,this._healthCheckLastTime=0,this._healthCheckPeriodInMSec=c._healthCheckPeriodMinInMSec,this._healthCheckId=a.Util.setTimeout(this._periodicHealthCheck,this._healthCheckPeriodInMSec,this),this._healthCheckRetries=0,this._dtOffsetToAdd=0,this._lastPlaybackBitrate=null,this._lastDownloadBitrate=null,this._manifestRefreshed=!1,this._registerInternalEvents(!0),this.timeBeforeSettingVideoElementSrcInMs=0,this._seekStartTime=0,this._canPlayThroughEvent=function(){e._disposed||e._pendingPlay&&e._buffersAbovePreroll()&&e._startPlayback()},this._durationChangeEvent=function(){if(!e._disposed){var b=e._sessionContext;b.eventMgr.dispatchEvent(a.EventName.durationchange),b.commonPresentation&&b.commonPresentation.isLive&&a.Util.setTimeout(f,c._durationChangeMinIntervalInMSec)}};var f=function(){if(!e._disposed){var b=e._sessionContext;b.commonPresentation&&b.commonPresentation.isLive&&(e._lastDuration!==e.duration?(e._lastDuration=e.duration,b.eventMgr.dispatchEvent(a.EventName.durationchange),a.Util.setTimeout(f,c._durationChangeMinIntervalInMSec)):0===e._lastDuration&&a.Util.setTimeout(f,c._durationChangeMinIntervalInMSec))}};this._resetHealthCheckTimeHandler=function(){e._resetHealthCheckTime()},this._resetSeekStartTimeHandler=function(){e._seekStartTime=0},this._checkPlaybackBitrate=function(){if(!e._disposed){var b=e._sessionContext.videoBufferData,c=b.getPlaybackBitrate(e.currentMediaTime);c!=e._lastPlaybackBitrate&&(e._lastPlaybackBitrate=c,e._sessionContext.eventMgr.dispatchEvent(a.EventName.playbackbitratechanged))}}}return c.prototype.dispose=function(){this._disposed||(this._registerInternalEvents(!1),this._registerVideoTagEvents(!1),this._disposed=!0,this._sessionContext=null,this._lastPresentation=null,this._pendingPresentation=null,this._canPlayThroughEvent=null,this._durationChangeEvent=null,this._resetHealthCheckTimeHandler=null,this._checkPlaybackBitrate=null,this._manifestRefreshed=!1,this._mediaSource&&(this._mediaSource.dispose(),this._mediaSource=null),this._workflowSeq&&(this._workflowSeq.dispose(),this._workflowSeq=null),this._videoStreamList&&(this._videoStreamList.dispose(),this._videoStreamList=null),this._audioStreamList&&(this._audioStreamList.dispose(),this._audioStreamList=null),this.timeBeforeSettingVideoElementSrcInMs=0,a.Util.clearTimeout(this._healthCheckId))},Object.defineProperty(c.prototype,"videoStreamList",{get:function(){return this._videoStreamList},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"audioStreamList",{get:function(){return this._audioStreamList},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"videoBufferData",{get:function(){return this._sessionContext.videoBufferData},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"audioBufferData",{get:function(){return this._sessionContext.audioBufferData},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"src",{get:function(){return this._sessionContext.presentationUrl},set:function(b){function d(b){function d(){return null!==g._playbackPosInSec&&g._sessionContext.videoTag.seeking?g._playbackPosInSec:g._sessionContext.videoTag.currentTime}function e(b){if(this._mediaSource){for(var c=this._mediaSource.sourceBuffers,d=!1,e=0;ec._timeSpentSettingVideoElementSrcThresholdInMs&&(a.Log.verbose(1,"Adjusting playable window because we spent too much time setting video element source."),i.adjustPlayableWindowForChromeSourceDelay(f))}if(!g._disposed){var h=!1;i.periods[0].streams.forEach(function(c){if(!h&&c.streamingInfo.selected&&2!==c.type){if(c.streamingInfo.sourceBuffer=g._mediaSource.addAdapterBuffer(c.codec,d,e,b.sessionContext.maxBufferInWallClockSec(),b.sessionContext.maxBufferBehindCurrentTimeInSec),!c.streamingInfo.sourceBuffer){g._error=new a.Failure.External(4194307,"presentationWorkflowResolved: Failed to create source buffer for stream "+a.Presentation.StreamType[c.type]+", codec "+c.codec),b.sessionContext.eventMgr.dispatchEvent(a.EventName.error),h=!0;var f=c.tracks;return void(f&&f.length>0&&f.forEach(function(b){var c='video/mp4;codecs="'+b._codecs+'"';a.Log.verbose(1,"MediaSource.isTypeSupported() for "+c+"= "+g._mediaSource.isTypeSupported(c))}))}0===c.type?g._sessionContext.videoBufferData.updateBuffer(c.streamingInfo.sourceBuffer):1===c.type&&g._sessionContext.audioBufferData.updateBuffer(c.streamingInfo.sourceBuffer),c.streamingInfo.sourceBuffer.presentationTimeOffsetInSec=c.presentationTimeOffsetInSec+g._dtOffsetToAdd}}),h||(g._updateStartPosition(),g._updateDuration(),g._registerVideoDownloadedEvents(),g._registerVideoTagEvents(!0),g._checkMediaWorkflow(),g._tryTimeUpdateEvent()),b.dispose()}}function h(a){throw new Error(a)}if(!g._disposed){var i=null;if(a.Log.verbose(1,"presentationWorkflowResolved"),null===b.sessionContext.commonPresentation)throw new Error("presentationWorkflowResolved: unexpected null values");i=b.sessionContext.commonPresentation,g._videoStreamList=new a.Presentation.VideoStreamList(g._sessionContext,i.periods[0].streams),g._audioStreamList=new a.Presentation.AudioStreamList(g._sessionContext,i.periods[0].streams);var j=null;g._audioStreamList&&g._audioStreamList.streams&&g._audioStreamList.streams.length>0&&g._audioStreamList.enabledIndices.length>0&&(a.assert(1==g._audioStreamList.enabledIndices.length,"Current implementation only allows one enabled stream at a time"),j=g._audioStreamList.streams[g._audioStreamList.enabledIndices[0]].codec);var k=null;g._videoStreamList&&g._videoStreamList.streams&&g._videoStreamList.streams.length>0&&-1!==g._videoStreamList.selectedIndex&&(k=g._videoStreamList.streams[g._videoStreamList.selectedIndex].codec),g._sessionContext.emeManager.setContentTypes(j,k),g._sessionContext.eventMgr.dispatchEvent(a.EventName.loadedmetadata),g._mediaSource=a.VideoElementAdapter.CreateAdapter(),g.timeBeforeSettingVideoElementSrcInMs=Date.now(),g._mediaSource.setVideoElementSrcAsync(b.sessionContext.videoTag).then(f,h)["catch"](function(b){g._sessionContext.eventMgr.dispatchEvent(a.InternalEventName.exception,b)})}}function e(b){g._disposed||(a.Log.error(1,"presentationWorkflowRejected: module: "+b.currentModuleId),b.externalFailure&&a.Failure.isExternalError(b.externalFailure.code)&&(g._error=new a.Failure.External(b.externalFailure.code,b.externalFailure.message),a.Log.error(1,"Dispatching error: "+g.error.toString()),b.sessionContext.eventMgr.dispatchEvent(a.EventName.error)),b.dispose())}a.Log.verbose(1,"src("+b+")");var f,g=this;this._sessionContext.presentationUrl=b,f=b.indexOf("?"),-1!==f&&(this._sessionContext.presentationQueryStr=b.slice(f)),this._presentationWorkflowAsync(d,e)},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"dtsOffsetToAdd",{get:function(){return this._dtOffsetToAdd},set:function(a){this._dtOffsetToAdd=a},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"pendingPlay",{get:function(){return this._pendingPlay},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"currentPresentationTime",{set:function(b){a.Log.verbose(1,"currentPresentationTime("+b.toFixed(3)+")"),this.setCurrentTimeInternal(b,!0)},enumerable:!0,configurable:!0}),c.prototype.setCurrentTimeInternal=function(b,c){var d=this._sessionContext,e=d.commonPresentation.periods[0].streams,f=!1,g=0,h=0,i=this.duration;if(d.commonPresentation.isLive){var j=d.commonPresentation.timeShiftBufferDepth||1/0,k=d.heuristicSettings.buffer.leftEdgeBackoffInSec,l=j-k;g=d.liveStartBufferInSec(),h=l>i?0:k}if(c){var m=this._fromPresentationTime(b),n=Math.max(m,h);n=Math.min(n,i-g),m!==n&&(b=this._toPresentationTime(n))}else a.Log.verbose(1,"timeInSec: "+b+", leftEdgeBackoff: "+h),b=Math.max(b,h),a.Log.verbose(1,"timeInSec: "+b+", duration: "+i+", rightEdgeBackoff: "+g),b=Math.min(b,i-g),h>b&&(a.Log.warning(1,"timeInSec: "+b+"is less than leftEdgeBackoff. Seeking to leftEdgeBackoff"),b=h),a.Log.verbose(1,"timeInSec: "+b),b=this._toPresentationTime(b);a.Log.verbose(1,"seeking from presentation time "+d.videoTag.currentTime.toFixed(3)+" to "+b.toFixed(3));for(var o=b,p=0;pd.videoTag.currentTime,this._playbackPosInSec=b,d.videoTag.currentTime=b,this._pendingPlaybackPosInSec=null,a.Common.diffTimes(d.videoTag.currentTime,b)&&(a.Log.verbose(1,"set currentTime failed to update videoTag: requested="+b+", actual="+d.videoTag.currentTime),this._pendingPlaybackPosInSec=b);for(var p=0;pg?0:i}var k=b*g;k=Math.max(k,f),k=Math.min(k,g-e),f>k&&(k=f);for(var l=this._toPresentationTime(k),m=l,n=0;n0&&h._pendingPresentation<=i){var j=Math.max(c._minPresentationUpdatePeriodInMSec,1e3*g.minimumUpdatePeriodInSec);h._pendingPresentation.setTime(i.getTime()+j),a.Util.setTimeout(e,j)}h._lastPresentation=i,h._manifestRefreshed=!0,b&&(b(f),b=null)}function g(b){h._disposed||a.Log.error(1,"presentationRequestRejected: module: "+b.currentModuleId),d&&d(b)}var h=this,i=0,j=Date.now()-h._lastPresentation.getTime();jg.videoTag.currentTime&&f._seekingForward||f._pendingPlaybackPosInSec0&&i.end(i.length-1)c._bufferTooFarAheadInSec}return!1}var i=a.streamingInfo.sourceBuffer.buffered;return 1===b||e===a||0===i.length?!1:a.streamingInfo.sourceBuffer.getBufferedAheadOfCurrentTimeInSec()>f&&i.end(i.length-1)-d>c._bufferTooFarAheadInSec},c.prototype._buffersAtLiveEdge=function(a){var b,c,d,e=this._sessionContext.commonPresentation;return a.streamingInfo.currentSegment?(b=a.streamingInfo.currentSegment.segmentInfo,c=b.presTimeInSec+b.durationInSec,d=e.playableWindow.endInSec,e.isLive&&0===e.minimumUpdatePeriodInSec&&c>=d):!1},c.prototype._textStreamTooFarAheadOfCurrentTimeDuringLive=function(a){if(!(this._sessionContext.commonPresentation&&this._sessionContext.commonPresentation.isLive&&2===a.type&&a.streamingInfo.currentSegment&&a.streamingInfo.currentSegment.segmentInfo))return!1;var b=a.streamingInfo.pendingSeekPositionInSec?a.streamingInfo.pendingSeekPositionInSec:a.streamingInfo.currentSegment.segmentInfo.presTimeInSec+a.maxSegmentDuration;return b-this._sessionContext.videoTag.currentTime>c._textStreamTooFarAheadOfCurrentTimeThresholdInSec},c.prototype._startPlayback=function(){var b=this._sessionContext.videoTag,d=this._dtOffsetToAdd;b.buffered&&b.buffered.length>0&&b.currentTime=0&&(h.beforeDiscontinuity(f,e)?(g=h.start(e+1),a.Log.verbose(1,"Health Check: skipping over discontinuity")):h.atOrAfterDiscontinuity(f,e)&&(g=h.start(e),a.Log.verbose(1,"Health Check: resetting on discontinuity"))),0>g&&(g=f+c._healthCheckSkipInSec,a.Log.verbose(1,"Health Check: skipping "+c._healthCheckSkipInSec+" seconds ahead"),b._healthCheckPeriodInMSec+=c._healthCheckPeriodIncrementInMSec,b._healthCheckPeriodInMSec=Math.min(b._healthCheckPeriodInMSec,c._healthCheckPeriodMaxInMSec)),a.Log.verbose(1,"Health Check: seeking from "+f+" to "+g),d.currentTime=g,-2===e){b._healthCheckRetries++;var i=b._sessionContext.commonPresentation.isLive;(!i||i&&b._healthCheckRetries>=c._healthCheckMaxRetries)&&b.pause()}}if(b._healthCheckLastTime=d.currentTime,b._seekStartTime){var j=Date.now()-b._seekStartTime;j>c._timeSpentSeekingThresholdInMs&&(a.Log.warning(1,"Spent too much time in a seek: "+j+"ms. Trying to get the player to resume playing."),b._seekStartTime=0,b.play())}}b._healthCheckId=a.Util.setTimeout(b._periodicHealthCheck,b._healthCheckPeriodInMSec,b)},c.prototype._resetHealthCheckTime=function(){this._disposed||(this._healthCheckLastTime=0)},c.prototype._flushVideoToPreroll=function(){function b(b,c){var d=c.prerollBufferInSec(),e=c.videoTag.currentTime+Math.max(d,1.5*b.maxSegmentDuration),g=null;f.flushStream=!1;var h=b.segments.getByInSegmentTimestamp(e);h?g=h.segmentInfo.presTimeInSec:(h=b.segments.getByInDiscontinuityTimestamp(e),h&&(g=h.segmentInfo.presTimeInSec)),null!=g&&f.sourceBuffer&&f.sourceBuffer.contains(g)&&(a.Log.verbose(7,"flushing at "+g+" from track selection"),f.sourceBuffer.flushFrom(g),f.pendingSeekPositionInSec=g,2===b.streamingInfo.workflowState&&(b.streamingInfo.workflowState=0))}if(a.Common.isChromiumEdge&&this._sessionContext&&this._sessionContext.emeManager&&this._sessionContext.emeManager.matchedKeySystem&&"PlayReady"===this._sessionContext.emeManager.matchedKeySystem.type)return void a.Log.warning(7,"Ignoring flush video request. See code comment for the reason.");var c=this._sessionContext.commonPresentation.periods[0].streams,d=c.filter(function(a){return a.streamingInfo.flushStream===!0});0===d.length&&(d=c);for(var e=0;e0&&(b._adSignaledInMpd=!0,b.sendAdSignals(a.sessionContext,e))}c()})},b.prototype.onGetMediaData=function(c){c.currentModuleId=this._moduleId;var d=this;return new Promise(function(e){var f=c.urlsToRetrieve.findFirst(function(a){return 1===a.requestType});if(!f||!f.mediaData)throw new Error(f.url+": no media segment data found");if(c.sessionContext.commonPresentation.isLive){var g=new DataView(f.mediaData),h=a.Mp4Util.GetEmsgBoxes(g);if(h){var i=[];h.forEach(function(d){if(d.schemeIdUrl===b._schemeIdUriScte35||d.schemeIdUrl===b._schemeIdUriSimple){var e=(d.timescale*f.presTimeInSec+d.presentationTimeDelta+c.requestedStream.rawPresentationTimeOffset)/d.timescale;if(a.Log.verbose(15,"ADSIGNAL: id: "+d.id+", mediaRequest.presTimeInSec: "+f.presTimeInSec+", presentationTimeDelta: "+d.presentationTimeDelta+", rawPresentationTimeOffset: "+c.requestedStream.rawPresentationTimeOffset+", presentationTime = "+e*d.timescale),d.schemeIdUrl===b._schemeIdUriScte35&&d.messageData){for(var g=new DataView(d.messageData.buffer),h="",j=0;j0?i.push({scteSignal:{signalInString:h,presentationTimeOverride:e}}):a.Log.verbose(15,"ADSIGNAL: skipping this one.")}else d.presentationTimeDelta>0?i.push({simpleSignal:{id:d.id,presentationTime:e,duration:d.eventDuration/d.timescale}}):a.Log.verbose(15,"ADSIGNAL: skipping this one.")}}),i.length>0&&d.sendAdSignals(c.sessionContext,i)}}e()})},b.prototype.extractAdSignal=function(c){var d=[],e=c.timescale;return c.schemeIdUri===b._schemeIdUriScte35?c.Event_asArray.forEach(function(b){var c=b.__text;if(c){var f=b.presentationTime;f&&(f/=e),d.push({scteSignal:{signalInString:c,presentationTimeOverride:f}}),a.Log.verbose(15,"ADSIGNAL mpd: presentationTime: "+f)}}):c.schemeIdUri===b._schemeIdUriSimple&&c.Event_asArray.forEach(function(b){var c=b.presentationTime;c&&(c/=e);var f=b.duration/e,g=b.id;d.push({simpleSignal:{id:g,presentationTime:c,duration:f}}),a.Log.verbose(15,"ADSIGNAL mpd: id: "+g+", presentationTime: "+c+", duration: "+f)}),d},b.prototype.sendAdSignals=function(a,b){a.adManager.addAdSignals(b)},b._schemeIdUriScte35="urn:scte:scte35:2013a:bin",b._schemeIdUriSimple="urn:com:adobe:dpi:simple:2015",b}();b.AdHandler=c}(a.Ad||(a.Ad={}));a.Ad}(AzureHtml5JS||(AzureHtml5JS={}));var AzureHtml5JS;!function(a){!function(b){"use strict";var c=function(){function b(){this._moduleId="AesHandler",this._disposed=!1,this._decryptor=new a.WebCryptoUtil.Decryptor}return b.prototype.dispose=function(){this._disposed||(this._disposed=!0,this._decryptor&&(this._decryptor.dispose(),this._decryptor=null))},b.prototype.init=function(a){var b=a.workflows[0],c=a.workflows[1];b.addHandler(b.stepEvents.requestEnd,this.onDownloadKey,this),c.addHandler(c.stepEvents.dataRetrieved,this.onDecrypt,this)},b.prototype.onDownloadKey=function(c){var d=this;return c.currentModuleId=this._moduleId,new Promise(function(e,f){function g(){k0&&(o[0]={name:a.HttpUtil.authorizationHeader,value:n});var p={maxRetries:c.sessionContext.httpRetryPolicySettings.maxRetriesForKeyAcquireFailure,maxWaitTimeBetweenRetriesMS:c.sessionContext.httpRetryPolicySettings.maxWaitTimeBetweenRetriesForKeyAcquireMS},q=Date.now();a.Log.verbose(12,"Starting AES key acquisition"),a.HttpUtil.httpRequestWithRetryConfig(k,"POST","arraybuffer",p,o).then(function(b){c.sessionContext.eventMgr.dispatchEvent(a.EventName.aesKeyFetchCompleted),i._decryptor.initialize(d.streamingInfo.aes,b,a.Common.hexStringToUint8Array(l)).then(function(){a.Log.verbose(12,"AES key acquisition in "+(Date.now()-q)+" ms"),c.sessionContext.eventMgr.dispatchEvent(a.EventName.decryptorInitialized,i._decryptor.type),g()},function(b){a.Log.error(12,"Failed to initialize decryptor: "),a.Failure.attachFailureToRequest(c,c.currentModuleId,5242882,"AES: "+b),f()})},function(b){a.Log.error(12,"Failed to download AES key url: "+k+", "+a.Common.toHexString(b.code)),a.Failure.attachFailureToRequest(c,c.currentModuleId,5242884,"Http: "+a.Common.toHexString(b.code)+", response: "+b.response),f()})}var i=d,j=c.sessionContext.commonPresentation.periods[0].streams,k=0;g()})},b.prototype.onDecrypt=function(b){var c=this;return b.currentModuleId=this._moduleId,new Promise(function(d,e){function f(){ithis._bandwidthSettings.bandwidthEstimationMaxKbps)return a.Log.verbose(5,"Ignoring bandwidth estimation "+Math.floor(b.bandwidth)+" Kbps, greater than configured max "+this._bandwidthSettings.bandwidthEstimationMaxKbps+" Kbps"),void this._averageCalc.dropOldestKeepAtLeastOne();var f;if(this._bandwidthSettings.useVariableFragmentSizeMode){var g=e.requestedStream.streamingInfo.currentSegment?a.StreamUtil.getSegmentDuration(e):d.durationInSec,h=d.bitrate;if(isNaN(h)||0>=h||isNaN(g)||0>=g||b.responseLengthInBytes<=0)return void a.Log.verbose(5,"Ignoring bandwidth estimation, supplied bitrate: "+h+", supplied chunk duration: "+g+", downloaded fragment size: "+b.responseLengthInBytes);var i=h*g,j=b.totalDownloadTimeMs-b.downloadTimeMs,k=j+i/(8*b.responseLengthInBytes)*b.downloadTimeMs;f=i/k,a.Log.verbose(5,"updateBandWidthInfo - vfsMode On, vfs bandwidth="+f+"kbps")}else f=b.bandwidth;var l=b.totalDownloadTimeMs;this._averageCalc.addValue(f),a.Log.verbose(5,"updateBandWidthInfo - currentBw: "+Math.floor(this._averageCalc.latest)+" Kbps averageBw: "+Math.floor(this._averageCalc.average)+" Kbps size: "+b.responseLengthInBytes+" bytes time-taken: "+l+" ms")},b.prototype.reportHeuristicsData=function(b,c){var d=this.perceivedBandwidth(),e=this._decryptionTracker?this._decryptionTracker.averageDecryptionSpeed:1/0;if(a.Log.verbose(5,"averageBW reporting: "+Math.round(d/1e3)+" Kbps decryptionBW: "+Math.round(e/1e3)+" Kbps, chunk duration: "+c),!c)throw new Error("reportHeuristicsData failed, invalid chunkDuration");for(var f=0;f=this.requestStartTimeInMS,"BandwidthInfo.totalDownloadTimeMs: unexpected values:"+this.responseEndTimeInMS+" should not be < "+this.requestStartTimeInMS),this.responseEndTimeInMS-this.requestStartTimeInMS||1},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"latencyTimeMs",{get:function(){return a.assert(this.responseStartTimeInMS>=this.requestStartTimeInMS,"BandwidthInfo.latencyTimeMs: unexpected values:"+this.responseStartTimeInMS+" should not be < "+this.requestStartTimeInMS),this.responseStartTimeInMS-this.requestStartTimeInMS||1},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"downloadTimeMs",{ get:function(){return a.assert(this.responseEndTimeInMS>=this.responseStartTimeInMS,"BandwidthInfo.downloadTimeMs: unexpected values:"+this.responseEndTimeInMS+" should not be < "+this.responseStartTimeInMS),this.responseEndTimeInMS-this.responseStartTimeInMS||1},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"bandwidth",{get:function(){return a.assert(this.totalDownloadTimeMs>0,"BandwidthInfo.bandwidth: unexpected value:"+this.totalDownloadTimeMs+" should be > 0"),8*this.responseLengthInBytes/this.totalDownloadTimeMs},enumerable:!0,configurable:!0}),b}();b.BandwidthInfo=d}(a.Heuristics||(a.Heuristics={}));a.Heuristics}(AzureHtml5JS||(AzureHtml5JS={}));var AzureHtml5JS;!function(a){!function(b){"use strict";var c=function(){function b(){this._moduleId="playReady",this._disposed=!1,this._initial=!0}return b.prototype.dispose=function(){this._disposed=!0},b.prototype.init=function(a){var b=a.workflows[0];b.addHandler(b.stepEvents.requestEnd,this.onContentProtected,this)},b.prototype.onContentProtected=function(b){var c=this;return b.currentModuleId=this._moduleId,new Promise(function(d,e){var f=[],g=b.sessionContext.commonPresentation;if(c._disposed)return a.Failure.attachFailureToRequest(b,b.currentModuleId,0),void e("Disposed");if(!c._initial)return void d();if(!g)throw new Error("CommonPresentation is empty");g.periods[0].streams.forEach(function(b){for(var c=0;c0&&b.sessionContext.emeManager.addPsshBoxes(f),c._initial=!1,d()})},b}();b.PlayReady=c}(a.ContentProtection||(a.ContentProtection={}));a.ContentProtection}(AzureHtml5JS||(AzureHtml5JS={}));var AzureHtml5JS;!function(a){!function(b){"use strict";var c=function(){function b(){this._moduleId="widevine",this._disposed=!1,this._initial=!0}return b.prototype.dispose=function(){this._disposed=!0},b.prototype.init=function(a){var b=a.workflows[0];b.addHandler(b.stepEvents.requestEnd,this.onContentProtected,this)},b.prototype.onContentProtected=function(b){var c=this;return b.currentModuleId=this._moduleId,new Promise(function(d,e){var f=[],g=b.sessionContext.commonPresentation;if(c._disposed)return a.Failure.attachFailureToRequest(b,b.currentModuleId,0),void e("Disposed");if(!c._initial)return void d();if(!g)throw new Error("CommonPresentation is empty");g.periods[0].streams.forEach(function(c){for(var d=0;d0&&b.sessionContext.emeManager.addPsshBoxes(f),c._initial=!1,d()})},b}();b.Widevine=c}(a.ContentProtection||(a.ContentProtection={}));a.ContentProtection}(AzureHtml5JS||(AzureHtml5JS={}));var AzureHtml5JS;!function(a){!function(b){"use strict";var c=function(){function b(){this._moduleId="DashMediaSegmentParser"}return b.prototype.dispose=function(){},b.prototype.init=function(a){var b=a.workflows[1];b.addHandler(b.stepEvents.dataRetrieved,this.onGetData,this)},b.prototype.onGetData=function(b){function c(b){var c=b.urlsToRetrieve.findFirst(function(a){return 1===a.requestType});if(c&&c.mediaData){var d=new DataView(c.mediaData),e=a.Mp4Util.GetEmsgBoxes(d);e&&e.length>0&&b.sessionContext.eventMgr.dispatchEvent(a.EventName.emsgAvailable,null,e)}}function e(){var c,e,g,h,i,j,k,l;l=b.requestedStream.streamingInfo.currentSegment;var m=b.urlsToRetrieve.findFirst(function(a){return 1===a.requestType});if(!m||!m.mediaData)throw new Error(m.url+": no media segment data found");if(c=new DataView(m.mediaData),e=a.Mp4Util.GetBoxByType(c,"moof"),!e)return new d(4194306,"moof not found");if(g=a.Mp4Util.GetBoxByType(e.data,"traf"),!g)return new d(4194306,"traf not found");if(h=a.Mp4Util.GetTfhdBox(g.data),!h)return new d(4194306,"tfhd not found");if(i=a.Mp4Util.GetTrunBox(g.data),!i)return new d(4194306,"trun not found");if(j=a.Mp4Util.GetTfdtBox(g.data),!j)return new d(4194306,"tfdt not found");if(a.Common.diffTimes(j.baseMediaDecodeTime,l.segmentInfo.mediaTimestamp))throw new Error("Segment mismatch, requested: "+l.segmentInfo.mediaTimestamp+" got: "+j.baseMediaDecodeTime);if(k=f(h,i),0===k)return new d(4194308,"failed to derive segment duration");a.Log.verbose(10,"Segment duration: "+k);var n=b.requestedStream.segments.updateSegmentDuration(l.segmentInfo.presTimeInSec,k);return n?(l.segmentInfo.mediaDuration=k,m.durationInSec=l.segmentInfo.durationInSec,null):new d(4194308,"failed to update segment duration in container")}function f(b,c){var d=0;return c.flags&a.Mp4Util.TrunBox.flags_sampleDurationPresent?c.sampleInfoArray.forEach(function(a){d+=a.sampleDuration}):b.defaultSampleDuration?d=b.defaultSampleDuration*c.sampleCount:a.Log.warning(10,"Cannot calculate segment duration from 'tfhd' and 'trun'"),d}function g(){var c=b.requestedStream,d=c.streamingInfo.currentSegment,e=d.segmentInfo,f=c.segments;e.mediaDuration&&f.addMediaSegmentInfo(e.index+1,a.Timestamp.add(e.mediaTimestampStr,e.mediaDuration),0/0,e.presentationOffset,e.timescale)}return b.currentModuleId=this._moduleId,new Promise(function(d,f){c(b);var h;if(h=b.requestedStream.streamingInfo.currentSegment,!b.sessionContext.commonPresentation.isLive||b.sessionContext.commonPresentation.minimumUpdatePeriodInSec||h.next)return void d();if(!h.segmentInfo.mediaDuration){var i=e();if(i)return a.Failure.attachFailureToRequest(b,b.currentModuleId,i.errorCode,i.message),void f()}g(),d()})},b}();b.Parser=c;var d=function(){function a(a,b){this.errorCode=a,this.message=b}return a}()}(a.DashMediaSegment||(a.DashMediaSegment={}));a.DashMediaSegment}(AzureHtml5JS||(AzureHtml5JS={}));var __extends=this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);c.prototype=b.prototype,a.prototype=new c},AzureHtml5JS;!function(a){!function(b){"use strict";function c(a){var b;if(!("schemeIdUri"in a))throw new Error("ContentProtection missing @schemeIdUri");return b=a.schemeIdUri,b.toLowerCase()===k.schemeIdUri?new k(a):b.toLowerCase()===l.schemeIdUri?new l(a):b.toLowerCase()===m.schemeIdUri?new m(a):new n(a)}var d=function(){function b(){this._moduleId="DashPresentationParser"}return b.prototype.dispose=function(){},b.prototype.init=function(a){var b=a.workflows[0];b.addHandler(b.stepEvents.dataRetrieved,this.onParse,this)},b.prototype.onParse=function(c){return c.currentModuleId=this._moduleId,new Promise(function(d,f){var g,h,i;if(!c.urlsToRetrieve[0].presentationData)throw new Error(c.urlsToRetrieve[0].url+": no presentation data found");g=c.sessionContext;var j=b._getPublishTime(c.urlsToRetrieve[0].presentationData);if(j&&g.commonPresentation&&g.commonPresentation.publishTime&&g.commonPresentation.publishTime.getTime()>=Date.parse(j))return a.Log.verbose(4,"skipping MPD parse, not newer than last parsed: "+c.urlsToRetrieve[0].url),void d();if(h=b._getBaseURL(g.presentationUrl),i=new e(c.urlsToRetrieve[0].presentationData,h),!i||!i.periods)return a.Failure.attachFailureToRequest(c,c.currentModuleId,4194305,c.urlsToRetrieve[0].url+": failed to generate DASH presentation"),void f("failed to generate DASH presentation");if(!b._validPresentation(i))return a.Failure.attachFailureToRequest(c,c.currentModuleId,4194307,c.urlsToRetrieve[0].url+": unsupported presentation"),void f("unsupported presentation");for(var k=i.periods[0].streams,l=0;l1)return a.Log.error(4,"invalid period count: "+(b.periods?b.periods.length.toString():"undefined")),!1;if(!b.periods[0].streams)return a.Log.error(4,"no streams found"),!1;for(var c=0;c]*>/i),b&&b.length>0&&(c=b[0].match(/publishTime="[^"]*/i),c&&c.length>0&&(d=c[0].slice(13)))),d},b._getBaseURL=function(a){var b,c=a;if(b=c.indexOf("?"),-1!==b&&(c=c.slice(0,b)),b=c.lastIndexOf("/"),-1===b)throw new Error(a+": could not derive base URL");return c=c.slice(0,b+1)},b}();b.Parser=d;var e=function(){function b(a,b){var c,d=this,e=[];if(this._lastRetrievalTime=new Date,c=Dash.dependencies.DashParser(),c.debug=new p,c.errHandler=new q,this._manifest=c.parse(a,b),this._manifest){if("Period_asArray"in this._manifest&&this._manifest.Period_asArray.length>0&&this._manifest.Period_asArray.forEach(function(a){e.push(new f(a,d.publishTime,d.isLive))}),this._periods=e,e.length>1)throw new Error("Error parsing MPD: multiple periods not supported");"dynamic"===this._manifest.type&&0===this._manifest.minimumUpdatePeriod&&(this._timeShiftTracker=new o(e,this._manifest.timeShiftBufferDepth))}}return Object.defineProperty(b.prototype,"segmentBoundaries",{get:function(){var a=[];if(this.periods&&this.periods.length>0&&this.periods[0].streams&&this.periods[0].streams.length>0)for(var b=0;b0&&this._periods[0].streams&&this._periods[0].streams.length>0&&this._periods[0].streams[0].segments&&this._periods[0].streams[0].segments.first&&this._periods[0].streams[0].producerReferenceTime)var c=this._periods[0].streams[0],d=c.segments.first.segmentInfo.timescale,e=c.producerReferenceTime.presentationTime/d,f=c.rawPresentationTimeOffset/d,g=a+f-e,h=c.producerReferenceTime.wallClockTime,b=new Date(h.getTime()+1e3*g);return b},Object.defineProperty(b.prototype,"timeShiftBufferDepth",{get:function(){return this._manifest.timeShiftBufferDepth},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"playableWindow",{get:function(){return new a.Common.TimeRange(this._playWindowLeftEdge(),this._playWindowLiveEdge())},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"maxSegmentDuration",{get:function(){var a=0;return this._periods.forEach(function(b){a=Math.max(a,b.maxSegmentDuration)}),a},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"periods",{get:function(){return this._periods},enumerable:!0,configurable:!0}),b.prototype.toJson=function(){return this._manifest},b.prototype.transferPresentationState=function(b){var c=b,d=[],e=[];this._manifest=c._manifest,this._lastRetrievalTime=c._lastRetrievalTime,this._timeShiftTracker=c._timeShiftTracker,this.periods.forEach(function(a){d.push(a)}),c.periods.forEach(function(a){e.push(a)});for(var f=0;f0&&a.Log.verbose(4,"Periods removed from MPD: "+d.length),e.length>0&&a.Log.verbose(4,"Periods added to MPD: "+e.length)},b.prototype.adjustPlayableWindow=function(a){this._timeShiftTracker&&this._timeShiftTracker.adjust(a)},b.prototype.adjustPlayableWindowForChromeSourceDelay=function(a){this._timeShiftTracker&&this._timeShiftTracker.adjustForChromeSourceDelay(a)},b.prototype._playWindowLeftEdge=function(){var a,b=0;return this._timeShiftTracker?this._timeShiftTracker.leftEdge:this._periods&&this._periods.length?(a=this._periods[0].streams,a&&a.length?(a.forEach(function(a){2!==a.type&&a.segments&&a.segments.first&&(b=Math.max(b,a.segments.first.segmentInfo.presTimeInSec))}),b):0):0},b.prototype._playWindowLiveEdge=function(){var a,b=1/0;return this._timeShiftTracker?this._timeShiftTracker.liveEdge:this._periods&&this._periods.length?(a=this._periods[0].streams,a&&a.length?(a.forEach(function(a){if(2!==a.type&&a.segments&&a.segments.last){var c=a.segments.last.segmentInfo;b=Math.min(b,c.presTimeInSec+(c.durationInSec||0))}}),b):0):0},b}();b.Mpd=e;var f=function(){function b(a,b,c){var d=this,e=[];this.startInSec="start"in a?a.start:0,"AdaptationSet_asArray"in a&&a.AdaptationSet_asArray.length>0&&a.AdaptationSet_asArray.forEach(function(a){e.push(new g(a,b,c,d.startInSec))}),this._streams=e}return Object.defineProperty(b.prototype,"streams",{get:function(){return this._streams},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"maxSegmentDuration",{get:function(){var a=0;return this._streams.forEach(function(b){a=Math.max(a,b.maxSegmentDuration)}),a},enumerable:!0,configurable:!0}),b.prototype.dispose=function(){this._streams&&(this._streams.forEach(function(a){a.dispose()}),this._streams=[])},b.prototype.transferPeriodState=function(b){var c=[],d=[];this.streams.forEach(function(a){c.push(a)}),b.streams.forEach(function(a){d.push(a)});for(var e=0;e0&&a.Log.verbose(4,"Adaptation Sets removed from period: "+c.length),d.length>0&&a.Log.verbose(4,"Adaptation Sets added to period: "+d.length)},b}();b.Period=f;var g=function(){function b(b,d,e,f){var g=[],j=[];if(this._adaptationSet=b,this.streamingInfo=new a.Presentation.MediaStreamStreamingInfo,"SegmentTemplate"in b&&(this._segmentTemplate=b.SegmentTemplate,"SegmentTimeline"in this._segmentTemplate)){var k,l,m,n;if(k=this._segmentTemplate.SegmentTimeline,l=this._segmentTemplate.timescale?this._segmentTemplate.timescale:1,m=f*l,this._rawPresentationTimeOffset=this._segmentTemplate.presentationTimeOffset?this._segmentTemplate.presentationTimeOffset:0,m-=this._rawPresentationTimeOffset,this._normalizedPtoInSec=m/l,n=new a.Presentation.MediaSegmentInfoContainer(l,m,d,e),"S_asArray"in k){var o,p="0";o=this._segmentTemplate.startNumber?this._segmentTemplate.startNumber:0;for(var q=0;q0&&a.Log.verbose(4,"Representations removed from MPD: "+c.length),d.length>0&&a.Log.verbose(4,"Representations added to MPD: "+d.length),this.segments.update(b.segments)},b}();b.AdaptationSet=g;var h=function(){function b(b){if(!("id"in b))throw new Error("Representation missing @id");if(this._id=b.id,!("bandwidth"in b))throw new Error("Representation missing @bandwidth");this._bitrate=b.bandwidth,this._height=b.height,this._width=b.width,this._codecs=b.codecs,this.streamingInfo=new a.Presentation.MediaTrackStreamingInfo}return Object.defineProperty(b.prototype,"id",{get:function(){return this._id},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"bitrate",{get:function(){return this._bitrate},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"height",{get:function(){return this._height},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"width",{get:function(){return this._width},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"codecs",{get:function(){return this._codecs},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"selectable",{get:function(){return this.streamingInfo.selectable},enumerable:!0,configurable:!0}),b.prototype.dispose=function(){},b}();b.Representation=h;var i=function(){function a(a){if(!("id"in a))throw new Error("ProducerReferenceTime missing @id");if(this._id=a.id,!("presentationTime"in a))throw new Error("ProducerReferenceTime missing @presentationTime");if(this._presentationTime=a.presentationTime,!("type"in a))throw new Error("ProducerReferenceTime missing @type");if(this._type=a.type,!("wallClockTime"in a))throw new Error("ProducerReferenceTime missing @wallClockTime");this._wallClockTime=a.wallClockTime}return Object.defineProperty(a.prototype,"id",{get:function(){return this._id},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"presentationTime",{get:function(){return this._presentationTime},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"type",{get:function(){return this._type},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"wallClockTime",{get:function(){return this._wallClockTime},enumerable:!0,configurable:!0}),a.prototype.dispose=function(){},a}();b.ProducerReferenceTime=i;var j=function(){function a(a){if(!("schemeIdUri"in a))throw new Error("ContentProtection missing @schemeIdUri");this.schemeIdUri=a.schemeIdUri,"value_str"in a?this._value=a.value_str:"value"in a&&(this._value=a.value),"id"in a&&(this._id=a.id)}return Object.defineProperty(a.prototype,"value",{get:function(){return this._value},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"id",{get:function(){return this._id},enumerable:!0,configurable:!0}),a.prototype.dispose=function(){},a}();b.BaseContentProtection=j;var k=function(a){function b(b){a.call(this,b),"pro"in b&&(this._specificData=b.pro.__text)}return __extends(b,a),b.prototype.data=function(a){return 0===a?this._specificData:null},b.prototype.dispose=function(){},b.schemeIdUri="urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95",b}(j);b.PlayReadyContentProtection=k;var l=function(a){function b(b){a.call(this,b),"pssh"in b&&(this._specificData=b.pssh.__text),"laurl"in b&&(this._laUrl=b.laurl.licenseUrl)}return __extends(b,a),Object.defineProperty(b.prototype,"laUrl",{get:function(){return this._laUrl},enumerable:!0,configurable:!0}),b.prototype.data=function(a){return 1===a?this._specificData:null},b.prototype.dispose=function(){},b.schemeIdUri="urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed",b}(j);b.WidevineContentProtection=l;var m=function(a){function b(b){if(a.call(this,b),"SegmentEncryption"in b&&(this._seaEncryptionSystemId=b.SegmentEncryption.schemeIdUri,"CryptoPeriod"in b)){var c=b.CryptoPeriod;"keyUriTemplate"in c&&(this._keyUri=c.keyUriTemplate),"IV"in c&&(this._iv=c.IV)}}return __extends(b,a),b.prototype.data=function(a){switch(a){case 2:return this._seaEncryptionSystemId;case 3:return this._keyUri;case 4:return this._iv;default:return null}},b.prototype.dispose=function(){},b.schemeIdUri="urn:mpeg:dash:sea:2012",b}(j);b.SegmentEncryptionContentProtection=m;var n=function(a){function b(b){a.call(this,b)}return __extends(b,a),b.prototype.data=function(){return null},b.prototype.dispose=function(){},b}(j);b.GenericContentProtection=n;var o=function(){function b(b,c){var d,e=0,f=1/0;b.length&&(d=b[0].streams,d&&d.length&&(d.forEach(function(a){2!==a.type&&a.segments&&a.segments.first&&a.segments.last&&(e=Math.max(e,a.segments.first.segmentInfo.presTimeInSec),f=Math.min(f,a.segments.last.segmentInfo.presTimeInSec+a.segments.last.segmentInfo.durationInSec))}),a.Log.verbose(4,"TimeShiftBufferTracker: leftEdge: "+e+" liveEdge: "+f+" duration: "+(f-e)),this._dvrWindowLenInSec=c?c:1/0,this._leftEdgeReferenceInPresentation=e,this._liveEdgeReferenceInPresentation=f,this._liveEdgeReferenceLocalTime=Date.now()))}return Object.defineProperty(b.prototype,"liveEdge",{get:function(){var a=(Date.now()-this._liveEdgeReferenceLocalTime)/1e3;return this._liveEdgeReferenceInPresentation+a},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"leftEdge",{get:function(){var a=(Date.now()-this._liveEdgeReferenceLocalTime)/1e3,b=this._liveEdgeReferenceInPresentation+a;return b-this._leftEdgeReferenceInPresentation=c?void a.Log.warning(4,"TimeShiftBufferTracker error, ignoring invalid adjustment: "+b):(a.Log.verbose(4,"Adjusting TimeShiftBufferTracker: "+b),void(this._liveEdgeReferenceInPresentation=c))},b.prototype.adjustForChromeSourceDelay=function(b){this._liveEdgeReferenceLocalTime=b,a.Log.verbose(4,"Adjusting TimeShiftBufferTracker: _liveEdgeReferenceLocalTime to "+b)},b}(),p=function(){function b(){this.log=function(b){a.Log.verbose(4,b)}}return b}(),q=function(){function b(){this.manifestError=function(b){a.Log.error(4,b)}}return b}()}(a.DashPresentation||(a.DashPresentation={}));a.DashPresentation}(AzureHtml5JS||(AzureHtml5JS={}));var AzureHtml5JS;!function(a){!function(b){"use strict";var c=function(){function b(){this._moduleId="DashUrlFormatter"}return b.prototype.init=function(a){var b=a.workflows[1];b.addHandler(b.stepEvents.requestSend,this.onUrlFormat,this)},b.prototype.dispose=function(){},b.prototype.onUrlFormat=function(b){return b.currentModuleId=this._moduleId,new Promise(function(c){if(!b.selectedTrack)throw new Error("Selected Track not set");var d=b.requestedStream.id;if(!d)throw new Error("stream id not set");var e=b.selectedTrack.bitrate;if(null===e||void 0===e)throw new Error("incorrect bitrate");var f=b.requestedStream.streamingInfo.currentSegment;if(!f)throw new Error("current segment not selected.");var g=f.segmentInfo.presTimeInSec;if(b.requestedStream.streamingInfo.fetchInitSegment){var h=b.requestedStream.initUrlTemplate;if(!h)throw new Error("initialization url template is not set for the stream");var i=a.Util.UrlFormatter.FormatDashInitUrl(h,e.toString(),b.sessionContext.presentationQueryStr);b.requestedStream.streamingInfo.fetchInitSegment=!1;var j=new a.Context.UrlRequest(i,2,0,d,e,g);b.urlsToRetrieve.push(j)}var k=b.requestedStream.mediaUrlTemplate;if(!k)throw new Error("media url template is not set for the stream");var l=f.segmentInfo.mediaTimestampStr,m=a.Util.UrlFormatter.FormatDashMediaUrl(k,e.toString(),l,b.sessionContext.presentationQueryStr);b.urlsToRetrieve.push(new a.Context.UrlRequest(m,1,0,d,e,g,f.segmentInfo.durationInSec)),c()})},b}();b.DashUrlFormatter=c}(a.UrlBuilder||(a.UrlBuilder={}));a.UrlBuilder}(AzureHtml5JS||(AzureHtml5JS={}));var AzureHtml5JS;!function(a){!function(b){"use strict";var c=function(){function b(){this._averageCalc=new a.Util.AverageCalculator(0,b._maxHistoryCount)}return Object.defineProperty(b.prototype,"averageDecryptionSpeed",{get:function(){return this._averageCalc.average},enumerable:!0,configurable:!0}),b.prototype.updateDecryptionSpeedInfo=function(a,b){var c=8*a/b;this._averageCalc.addValue(c)},b._maxHistoryCount=3,b}();b.DecryptionTracker=c}(a.Heuristics||(a.Heuristics={}));a.Heuristics}(AzureHtml5JS||(AzureHtml5JS={}));var AzureHtml5JS;!function(a){!function(b){"use strict";var c=function(){function b(){this._moduleId="heuristics.Engine",this._disposed=!1}return b.prototype.dispose=function(){this._disposed=!0},b.prototype.init=function(a){var b=a.workflows[1];b.addHandler(b.stepEvents.requestSend,this.onGetIndex,this)},b.prototype.onGetIndex=function(b){function c(){b.selectedTrack!==b.requestedStream.streamingInfo.lastDownloadedTrack&&(b.requestedStream.streamingInfo.fetchInitSegment=!0)}function d(c){var d=b.heuristicData.tracksData;if(!c)throw new Error("findHighestTrack failed, invalid timeEstimationThresholdInSec");a.Log.verbose(8,"Time we have for fragment download: "+c+"s");for(var e=d.length-1;e>=0;e--)if(d[e].selectable&&d[e].dataRetrieverEstimationInWallClockSec*b.sessionContext.playbackRate()=0;d--){var e=a[d];e.selectable&&(c=Math.min(c,e.dataRetrieverEstimationInWallClockSec))}return c}function f(a){for(var c=b.heuristicData.tracksData,d=null,e=c.length-1;e>=0;e--){var f=c[e];f.selectable&&f.trackInfo.bitrate>a&&(!d||f.trackInfo.bitratel&&!b.sessionContext.videoTag.paused&&(m*=b.sessionContext.heuristicSettings.belowDowngradeBufferLevelDownloadTimeFactor);var p=d(m);!p&&e()===1/0&&b.requestedStream.streamingInfo.lastDownloadedTrack&&(p=f(b.requestedStream.streamingInfo.lastDownloadedTrack.bitrate)),(!p||l>n&&p.bitrate=b.sessionContext.heuristicSettings.stepRule.minSegmentsBeforeDowngrade,h=d._currentTrackSegmentCount>=b.sessionContext.heuristicSettings.stepRule.minSegmentsBeforeUpgrade,i=b.requestedStream.tracks.indexOf(d._previousTrackSelected),j=i,k=i;g&&b.sessionContext.heuristicSettings.stepRule.maxStepDownInQuality>0&&(j=Math.max(0,i-b.sessionContext.heuristicSettings.stepRule.maxStepDownInQuality)),h&&b.sessionContext.heuristicSettings.stepRule.maxStepUpInQuality>0&&(k=Math.min(b.heuristicData.tracksData.length-1,i+b.sessionContext.heuristicSettings.stepRule.maxStepUpInQuality));for(var l=0;lk||j>l)&&(b.heuristicData.tracksData[l].selectable=!1);e()})},b}();b.StepRule=c}(a.Heuristics||(a.Heuristics={}));a.Heuristics}(AzureHtml5JS||(AzureHtml5JS={}));var AzureHtml5JS;!function(a){!function(b){"use strict";var c=function(){function b(){this._moduleId="windowSizeRule",this._disposed=!1,this._windowHeight=0,this._windowWidth=0,this._highestTrackIndexAllowed=0,this._currentSelectedVideoStream=null}return b.prototype.dispose=function(){this._disposed=!0,this._currentSelectedVideoStream=null},b.prototype.init=function(a){var b=a.workflows[1];b.addHandler(b.stepEvents.requestBegin,this.onRunWindowSizeRule,this)},b.prototype.onRunWindowSizeRule=function(b){a.Log.verbose(8,"onRunWindowSizeRule"),b.currentModuleId=this._moduleId;var c=!1,d=this;return new Promise(function(e,f){if(d._disposed)return a.Failure.attachFailureToRequest(b,b.currentModuleId,0),void f("object is already disposed.");if(b.selectedTrack||!b.sessionContext.heuristicSettings.windowSizeHeuristicsEnabled||0!==b.requestedStream.type)return void e();b.requestedStream!==d._currentSelectedVideoStream&&(d._currentSelectedVideoStream=b.requestedStream,d._highestTrackIndexAllowed=0);var g,h;if(b.sessionContext.heuristicSettings.useBrowserWindowForWindowSizeRule?(g=window.innerWidth,h=window.innerHeight):(g=Math.max(b.sessionContext.videoTag.scrollWidth,b.sessionContext.videoTag.width),h=Math.max(b.sessionContext.videoTag.scrollHeight,b.sessionContext.videoTag.height)),0===h||0===g)return a.Log.warning(8,"Ignoring window size heuristic rule, as one of the window dimensions is 0."),void e();(d._windowWidth!==g||d._windowHeight!==h)&&((d._windowWidthg&&i[m].trackInfo.height>h&&(j?i[m].trackInfo.width==k&&i[m].trackInfo.height==l?d._highestTrackIndexAllowed=m:i[m].selectable=!1:(j=!0,d._highestTrackIndexAllowed=m,k=i[m].trackInfo.width,l=i[m].trackInfo.height));j||(d._highestTrackIndexAllowed=i.length-1),c&&b.requestedStream.streamingInfo.lastDownloadedTrack&&i[d._highestTrackIndexAllowed].trackInfo.bitrate>b.requestedStream.streamingInfo.lastDownloadedTrack.bitrate&&b.sessionContext.eventMgr.dispatchEvent(a.InternalEventName.flushvideo),e()})},b}();b.WindowSizeRule=c}(a.Heuristics||(a.Heuristics={}));a.Heuristics}(AzureHtml5JS||(AzureHtml5JS={}));var AzureHtml5JS;!function(a){!function(b){"use strict";var c;!function(a){a[a.success=200]="success",a[a.notFound=404]="notFound",a[a.badGateway=502]="badGateway"}(c||(c={}));var d=function(){function b(b){this._moduleId="httpDataRetriever",this._requestList=[],this._disposed=!1,this._bandwidthRequest=null,this._bandwidthData=new a.Heuristics.BandwidthTracker(b.heuristicSettings.bandwidth,b.decryptionTracker),b.videoBufferData.updateBandwidthTracker(this._bandwidthData)}return b.prototype.dispose=function(){for(;this._requestList.length>0;){var a=this._requestList.pop();a.request=null,a=null}this._bandwidthRequest=null,this._disposed=!0},b.prototype.init=function(a){var b=a.workflows[0],c=a.workflows[1];b.addHandler(b.stepEvents.requestBegin,this.onGetData,this),b.addHandler(b.stepEvents.requestEnd,this.onGetData,this),c.addHandler(c.stepEvents.requestBegin,this.onReportHeuristicData,this),c.addHandler(c.stepEvents.requestSend,this.onGetData,this)},b.prototype.onReportHeuristicData=function(b){a.Log.verbose(5,"onReportHeuristicData"),b.currentModuleId=this._moduleId;var c=this;return new Promise(function(d,e){return c._disposed?(a.Failure.attachFailureToRequest(b,b.currentModuleId,0),void e("object is already disposed.")):0!==b.requestedStream.type?void d():(c._bandwidthData.reportHeuristicsData(b.heuristicData,a.StreamUtil.getSegmentDuration(b)),void d())})},b.prototype.getResponseHeaders=function(a,b){for(var c=b.sessionContext.headers||[],d={},e=0;e0,"Failed to start the download as urlToRetrieve at index "+s+" is empty"),c.requestedStream&&(c.requestedStream.streamingInfo.abortCurrentRequest=!1),d._bandwidthRequest&&d._bandwidthRequest.req.streamId===c.urlsToRetrieve[s].streamId&&d._bandwidthRequest.req.presTimeInSec===c.urlsToRetrieve[s].presTimeInSec){var e=c.heuristicData.tracksData.findFirst(function(a){return a.trackInfo.bitrate===d._bandwidthRequest.req.bitrate});e&&d._bandwidthRequest.req.bitrate>=c.urlsToRetrieve[s].bitrate?2===c.urlsToRetrieve[s].requestType?d._bandwidthRequest.req.bitrate!==c.urlsToRetrieve[s].bitrate&&(a.Log.verbose(5,"Switching init segment request "+c.urlsToRetrieve[s].url+" to "+d._bandwidthRequest.req.bitrate),c.urlsToRetrieve[s].bitrate=d._bandwidthRequest.req.bitrate,c.urlsToRetrieve[s].url=a.Util.UrlFormatter.FormatDashInitUrl(c.requestedStream.initUrlTemplate,d._bandwidthRequest.req.bitrate.toString(),c.sessionContext.presentationQueryStr),c.selectedTrack=e.trackInfo):(a.Log.verbose(5,"Reusing bandwidth request "+d._bandwidthRequest.req.url),c.urlsToRetrieve[s].dispose(),c.urlsToRetrieve[s]=d._bandwidthRequest.req,1===c.workflowType&&a.StreamUtil.getBufferData(c).dispatchDownloadCompleted(p(s),d._bandwidthRequest.info,d._bandwidthRequest.headers),d._bandwidthRequest=null):(d._bandwidthRequest.req.dispose(),d._bandwidthRequest=null)}if(0===c.urlsToRetrieve[s].responseType&&null!=c.urlsToRetrieve[s].mediaData||4===c.urlsToRetrieve[s].responseType&&null!=c.urlsToRetrieve[s].presentationData){if(4===c.urlsToRetrieve[s].responseType&&null!=c.sessionContext.commonPresentation){var g=c.sessionContext.httpDataRetrieverSettings,h=1e3*c.sessionContext.commonPresentation.maxSegmentDuration;g.timeoutInMSec=Math.max(g.timeoutInMSec,2*h),g.timeoutInMSec=Math.min(g.timeoutInMSec,g.maxTimeoutInMSec),a.Log.verbose(5,"Setting data retriever timeout: "+g.timeoutInMSec+" ms")}s++,s>=c.urlsToRetrieve.length?q(null):i()}else{1===c.workflowType&&a.StreamUtil.getBufferData(c).dispatchDownloadRequested(p(s));var o=c.sessionContext.createXmlHttpRequest();o.open("GET",c.urlsToRetrieve[s].url),o.onreadystatechange=j,o.onprogress=k,o.onload=l,o.onerror=m,o.ontimeout=n,o.onabort=m,0===c.urlsToRetrieve[s].responseType&&(o.responseType=a.Context.ResponseType[0]),o.msCaching&&(o.msCaching="disabled"),o.timeout=c.sessionContext.httpDataRetrieverSettings.timeoutInMSec;var r=new f(c.urlsToRetrieve[s],o);if(c.requestedStream&&0==c.requestedStream.type&&c.selectedTrack?a.Log.verbose(5,"HeuristicInfo: SuggestedBr: "+c.selectedTrack.bitrate+" CurrentBw: "+Math.floor(1e3*d._bandwidthData.latestInKbps)+" AverageBw: "+Math.floor(1e3*d._bandwidthData.averageBandwidthInKbps)+" BufferSize: "+c.requestedStream.streamingInfo.sourceBuffer.getBufferedAheadOfCurrentTimeInSec()+" StreamType: "+a.Presentation.StreamType[c.requestedStream.type]+" StreamName: "+c.requestedStream.language+" Index: "+c.requestedStream.streamingInfo.currentSegment.segmentInfo.index+" TimeInMS: "+c.requestedStream.streamingInfo.currentSegment.segmentInfo.presTimeInSec+" MediaTimeStamp: "+c.requestedStream.streamingInfo.currentSegment.segmentInfo.mediaTimestamp+" Index: "+c.requestedStream.streamingInfo.currentSegment.segmentInfo.index+" Duration: "+(c.requestedStream.streamingInfo.currentSegment.segmentInfo.durationInSec||0)+" Url: "+c.urlsToRetrieve[s].url+" TimeoutInMS: "+c.sessionContext.httpDataRetrieverSettings.timeoutInMSec):0===c.workflowType&&a.Log.verbose(5,"Getting "+c.urlsToRetrieve[s].url),d._requestList.push(r),a.Common.isEdge){var t=function(c){if(!d._disposed&&c.urlRequest.url){var e=Date.now();a.Log.verbose(5,"Network req check: time since last progress: "+(e-c.lastProgressTimestamp)+" ,"+c.networkRequestCheckTimerId+", "+c.urlRequest.url),e-c.lastProgressTimestamp>o.timeout?(a.Log.verbose(5,"Stale http request with failed timeout. Aborting request: "+c.networkRequestCheckTimerId+", "+c.urlRequest.url),c.abortRequest()):c.networkRequestCheckTimerId=a.Util.setTimeout(t,b._networkRequestCheckPeriodInMSec,c)}};1===c.workflowType&&(r.networkRequestCheckTimerId=a.Util.setTimeout(t,b._networkRequestCheckPeriodInMSec,r))}o.send()}}function j(){var b=this;if(!d._disposed){var c=d._requestList.findFirst(function(a){return a.request===b});a.assert(null!=c,"cannot find the request in the request queue"),c.request.readyState>=XMLHttpRequest.HEADERS_RECEIVED&&!c.bandwidthInfo.responseStartTimeInMS&&(c.bandwidthInfo.responseStartTimeInMS=Date.now(),c.request.onreadystatechange=null)}}function k(b){var e=this;if(!d._disposed){var f=Date.now(),g=d._requestList.findFirst(function(a){return a.request===e});if(a.assert(null!=g,"cannot find the request in the request queue"),g.lastProgressTimestamp=f,!(a.Common.isSafari&&a.Common.isOSXElCapitanOrEarlier()&&g.getIsAbortInProgress())){if(g.request.readyState>=XMLHttpRequest.HEADERS_RECEIVED&&!g.bandwidthInfo.responseStartTimeInMS&&(g.bandwidthInfo.responseStartTimeInMS=f),c.requestedStream&&c.requestedStream.streamingInfo.abortCurrentRequest&&g.request.readyState<4)return g.abortRequest(),void a.Log.verbose(5,"Aborting request: "+g.urlRequest.url);if(0===b.loaded){var h=g.bandwidthInfo.responseStartTimeInMS,i=c.sessionContext.httpDataRetrieverSettings.noDataTimeoutInMSec;if(f-h>i)return g.abortRequest(),void a.Log.verbose(5,"Aborting request after timeout with no data received: "+g.urlRequest.url)}if(3===g.urlRequest.requestType){var h=g.bandwidthInfo.responseStartTimeInMS,i=c.sessionContext.httpDataRetrieverSettings.initBandwidthTimeoutInMSec;if(f-h>i){g.bandwidthInfo.responseLengthInBytes=b.loaded,g.bandwidthInfo.responseEndTimeInMS=f;var j=c.sessionContext&&c.sessionContext.commonPresentation&&c.sessionContext.commonPresentation.isLive;d._bandwidthData.updateBandwidthInfo(g.bandwidthInfo,j,g.urlRequest,c),g.abortRequest(),a.Log.verbose(5,"Aborting init bandwidth request due to timeout: "+g.urlRequest.url)}}}}}function l(){var b=this;if(!d._disposed){var f=d._requestList.findFirst(function(a){return a.request===b});a.assert(null!=f,"cannot find the request in the request queue"),f.bandwidthInfo.responseEndTimeInMS=Date.now(),d.stopNetworkRequestCheck(f);var g=c.urlsToRetrieve.indexOf(f.urlRequest);if(c.urlsToRetrieve[g].httpResposeContentType=this.getResponseHeader("Content-Type"),c.urlsToRetrieve[g].httpResponseCode=this.status,200===this.status){switch(d._requestList.removeFirst(function(a){return a.request===b}),f.urlRequest.responseType){case 0:c.urlsToRetrieve[g].mediaData=this.response,f.bandwidthInfo.responseLengthInBytes=c.urlsToRetrieve[g].mediaData.byteLength;var h=d.getResponseHeaders(this,c);1===c.workflowType?a.StreamUtil.getBufferData(c).dispatchDownloadCompleted(p(g),f.bandwidthInfo,h):(d._bandwidthRequest=new e(c.urlsToRetrieve[g].clone(),f.bandwidthInfo,h),d._bandwidthRequest.req.requestType=1,c.sessionContext.eventMgr.dispatchEvent(a.EventName.initialBandwidthEstimationCompleted));break;case 4:c.urlsToRetrieve[g].presentationData=this.response,f.bandwidthInfo.responseLengthInBytes=c.urlsToRetrieve[g].presentationData.length,c.sessionContext.eventMgr.dispatchEvent(a.EventName.manifestFetchCompleted);break;default:a.assert(!1,"Unexpected response Type in the request Context")}var j=this.getResponseHeader("Content-Length");if(null===j&&(j="unknown"),a.Log.verbose(5,"Download Finished for : "+f.urlRequest.url+" with bytes: "+f.bandwidthInfo.responseLengthInBytes+", contentLength: "+j),c.requestedStream){var k=c.sessionContext&&c.sessionContext.commonPresentation&&c.sessionContext.commonPresentation.isLive;d._bandwidthData&&0===c.requestedStream.type&&d._bandwidthData.updateBandwidthInfo(f.bandwidthInfo,k,f.urlRequest,c),c.requestedStream.streamingInfo.lastDownloadedTrack=c.selectedTrack}if(s++,a.Log.verbose(5,"index="+s+", urlsToRetrieve.length="+c.urlsToRetrieve.length),s>=c.urlsToRetrieve.length)return void q(f);a.Log.verbose(5,"Next request to process: "+c.urlsToRetrieve[s].url),i()}else a.Log.error(5,f.urlRequest.url+" failed, httpStatus: "+this.status),o.call(this,a.Failure.translateHttpStatusToCode(this.status))}}function m(b){if(!d._disposed){var c=2097152;"error"===b.type?c=a.Common.clientIsOffline()?2097755:2097753:"abort"===b.type&&(c=2097754),o.call(this,c,"http: "+b.type)}}function n(b){var e=this;if(!d._disposed){var f=d._requestList.findFirst(function(a){return a.request===e});if(a.assert(null!=f,"cannot find the request in the request queue"),b.loaded&&1===f.urlRequest.requestType){var g=c.sessionContext&&c.sessionContext.commonPresentation&&c.sessionContext.commonPresentation.isLive;f.bandwidthInfo.responseLengthInBytes=b.loaded,f.bandwidthInfo.responseEndTimeInMS=Date.now(),d._bandwidthData.updateBandwidthInfo(f.bandwidthInfo,g,f.urlRequest,c)}o.call(this,2097752,"http timed out")}}function o(b,e){var f=this,g=d._requestList.removeFirst(function(a){return a.request===f});!a.Common.isFirefox&&a.Common.isSafari&&a.Common.isOSXElCapitanOrEarlier()||a.assert(null!=g,"cannot find the request in the request queue");var h=!1;c.requestedStream&&c.requestedStream.streamingInfo.abortCurrentRequest&&(c.requestedStream.streamingInfo.abortCurrentRequest=!1,h=!0);var i=null!=g?g.urlRequest.url:"no details info";e&&(i+=", "+e);var j=new a.Failure.Record(c.currentModuleId,b,i);if(a.Log.error(5,j.toString()),null!=g)if(c.requestedStream){-1!==c.urlsToRetrieve.findIndexOf(function(a){return 2===a.requestType})&&(c.requestedStream.streamingInfo.fetchInitSegment=!0);var k=c.urlsToRetrieve.indexOf(g.urlRequest);if(1===c.workflowType&&a.StreamUtil.getBufferData(c).dispatchDownloadFailed(p(k),b,e),2097556===b&&c.sessionContext.commonPresentation.isLive&&c.requestedStream.streamingInfo&&c.requestedStream.streamingInfo.currentSegment&&!c.requestedStream.streamingInfo.currentSegment.next){var l=c.requestedStream.streamingInfo.currentSegment.segmentInfo,m=l?l.presTimeInSec:null;c.requestedStream.streamingInfo.currentSegment=c.requestedStream.streamingInfo.currentSegment.prev,c.failTracker.reset(),a.Log.verbose(5,"hit past live edge with 404: "+(e?e+", ":"")+"presTimeInSec: "+m+" "+g.urlRequest.url),c.externalFailure=j,r(g)}else if(2097564===b&&c.sessionContext.commonPresentation.isLive&&c.requestedStream.streamingInfo&&c.requestedStream.streamingInfo.currentSegment&&!c.requestedStream.streamingInfo.currentSegment.next){if(c.state=2,c.retryWaitTimeMSec=c.sessionContext.httpRetryPolicySettings.retryMediaInMSec,c.failTracker.log(j,c.selectedTrack,c.requestedStream.type),2!==c.requestedStream.type){var n=c.sessionContext.httpDataRetrieverSettings.liveEdgeAdjustmentInSec;c.sessionContext.commonPresentation.adjustPlayableWindow(n)}else c.retryWaitTimeMSec=c.sessionContext.httpRetryPolicySettings.retryDueTo412InTextTrackInMSecDefault;var l=c.requestedStream.streamingInfo.currentSegment.segmentInfo,m=l?l.presTimeInSec:null;a.Log.verbose(5,"hit past live edge with 412: "+(e?e+", ":"")+"presTimeInSec: "+m+" "+g.urlRequest.url),q(g)}else 0!==c.workflowType&&g&&g.urlRequest&&3!==g.urlRequest.requestType&&(c.state=2,c.failTracker.log(j,c.selectedTrack),c.failTracker.noDataReceivedFailure=!g.bandwidthInfo.responseLengthInBytes,c.retryWaitTimeMSec=c.failTracker.isLastServerError()?c.sessionContext.httpRetryPolicySettings.retryMediaServerErrorInMSec:2097753===b||2097755===b?c.sessionContext.httpRetryPolicySettings.retryDueToNetworkErrorInMSec:0),a.Log.error(5,"failed to download: "+(e?e+", ":"")+g.urlRequest.url),q(g)}else 0!==c.workflowType||2097556!==b&&2097752!==b&&2097753!==b&&2097755!==b?(c.externalFailure=j,a.Log.error(5,"failed to download: "+(e?e+", ":"")+g.urlRequest.url),r(g)):(c.state=2,c.retryWaitTimeMSec=2097556===b?c.sessionContext.httpRetryPolicySettings.retryPresentationInMSec:2097753===b||2097755===b?c.sessionContext.httpRetryPolicySettings.retryDueToNetworkErrorInMSec:0,c.failTracker.log(j),a.Log.error(5,"failed to download: "+(e?e+", ":"")+g.urlRequest.url),q(g));h&&c.failTracker.reset()}function p(b){var d=c.urlsToRetrieve[b],e=c.requestedStream.presentationTimeOffsetInSec,f=c.requestedStream.streamingInfo.currentSegment.segmentInfo,g=2===d.requestType?null:f.mediaTimestamp/f.timescale;return new a.Context.MediaDownload(d.url,c.selectedTrack.bitrate,g,d.mediaData,e,f.timescale,f.durationInSec)}function q(a){a&&d.stopNetworkRequestCheck(a),g()}function r(a,b){a&&d.stopNetworkRequestCheck(a),b?h(b):h()}if(d._disposed)return a.Failure.attachFailureToRequest(c,c.currentModuleId,0),void r(null,"object is already disposed.");a.assert(0!==c.urlsToRetrieve.length,"Failed to start the download as urlsToRetrieve is empty.");var s=0;i()})},b.prototype.stopNetworkRequestCheck=function(b){b.networkRequestCheckTimerId&&(a.Util.clearTimeout(b.networkRequestCheckTimerId),b.networkRequestCheckTimerId=0)},b._networkRequestCheckPeriodInMSec=2e3,b}();b.HttpDataRetriever=d;var e=function(){function a(a,b,c){this.req=a,this.info=b,this.headers=c}return a}(),f=function(){function b(b,c){this.urlRequest=b,this.request=c,this.bandwidthInfo=new a.Heuristics.BandwidthInfo,this.abortStarted=!1,this.lastProgressTimestamp=Date.now(),this.networkRequestCheckTimerId=0}return b.prototype.abortRequest=function(){this.abortStarted=!0,this.request.abort()},b.prototype.getIsAbortInProgress=function(){return this.abortStarted},b}()}(a.DataRetriever||(a.DataRetriever={}));a.DataRetriever}(AzureHtml5JS||(AzureHtml5JS={}));var AzureHtml5JS;!function(a){!function(b){"use strict";var c;!function(a){a[a.noRetry=0]="noRetry",a[a.nextTrack=1]="nextTrack",a[a.nextTrackDown=2]="nextTrackDown",a[a.nextSegment=3]="nextSegment",a[a.same=4]="same"}(c||(c={}));var d=function(){function b(){this._moduleId="httpRetryPolicy",this._disposed=!1}return b.prototype.dispose=function(){this._disposed||(this._disposed=!0)},b.prototype.init=function(a){var b=a.workflows[0],c=a.workflows[1];b.addHandler(c.stepEvents.requestBegin,this.onPresentationRetry,this),c.addHandler(c.stepEvents.requestBegin,this.onMediaRetry,this)},b.prototype.onPresentationRetry=function(b){var d=this;return a.Log.verbose(5,"onPresentationRetry"),b.currentModuleId=this._moduleId,new Promise(function(e,f){if(d._disposed)return a.Failure.attachFailureToRequest(b,b.currentModuleId,0),void f("object is already disposed.");var g=b.failTracker,h=b.sessionContext.httpRetryPolicySettings;if(g.isNone())return void e();var i=d._getAction(0,h,b);switch(i){case 0:return b.externalFailure=g.lastFailure,a.Log.verbose(5,"onPresentationRetry: noRetry, "+b.urlsToRetrieve[0].url),void f();case 4:g.sameRequestRetried++;break;default:throw new Error("unexpected retry action: "+i)}g.totalRetried++,a.Log.verbose(5,"onPresentationRetry: "+c[i]+" URL: "+b.urlsToRetrieve[0].url),e()})},b.prototype.onMediaRetry=function(b){var d=this;return a.Log.verbose(5,"onMediaRetry"),b.currentModuleId=this._moduleId,new Promise(function(e,f){if(d._disposed)return a.Failure.attachFailureToRequest(b,b.currentModuleId,0),void f("object is already disposed.");if(!b.requestedStream)return void e();var g=b.failTracker,h=b.requestedStream.streamingInfo,i=b.sessionContext.httpRetryPolicySettings;if(g.isNone()||null!==h.pendingSeekPositionInSec)return void e();0===g.totalRetried&&(g.tracksToTry=d._createTrackToTry(i,b.requestedStream,g.lastTrack));var j=d._getAction(1,i,b);switch(j){case 0:return b.externalFailure=g.lastFailure,a.Log.verbose(5,"onMediaRetry: noRetry,mediaTimestamp: "+h.currentSegment.segmentInfo.mediaTimestamp),void f();case 1:case 2:var k,l;g.sameRequestRetried++,b.selectedSegment=h.currentSegment,l=g.trackToTryIdx=b.maxRetryPresentation?0:4;else if(f.totalRetried>=b.maxTotalRetries&&2!==f.lastStreamType||f.segmentsSkipped>=b.maxSkipSegments&&(f.trackToTryIdx>=f.tracksToTry.length-1||f.sameRequestRetried>=b.maxRetryPerSegment))d=b.infiniteSegmentRetryForPreconditionFailed&&e&&this._isLiveEdge(c)&&f.isLastNotReady()?4:0;else if(f.isSegmentDecryptionError()||f.isLastNotFound()||f.isLastNotReady()&&e&&!this._isLiveEdge(c))d=f.trackToTryIdx=b.maxRetryPerSegment&&2!==f.lastStreamType&&!b.infiniteSegmentRetryForPreconditionFailed&&(d=0);else if(f.isLastServerError())d=1;else if(f.isLastNetworkFail()){var g=e&&this._isLiveEdge(c)&&f.isLastNetworkDown()?3*b.maxRetryPerSegment:b.maxRetryPerSegment;d=f.sameRequestRetried=0;g--)b.tracks[g].streamingInfo.selectable&&d.push(b.tracks[g]);if(!a.retryLowerBitrateOnly)for(var g=e+1;f>g;g++)b.tracks[g].streamingInfo.selectable&&d.push(b.tracks[g]);return d},b}();b.HttpRetryPolicy=d}(a.DataRetriever||(a.DataRetriever={}));a.DataRetriever}(AzureHtml5JS||(AzureHtml5JS={}));var AzureHtml5JS;!function(a){!function(b){"use strict";var c;!function(a){a[a.success=200]="success",a[a.notFound=404]="notFound",a[a.badGateway=502]="badGateway"}(c||(c={}));var d=function(){function b(){this._moduleId="InitialBandwidthDataUrlFormatter",this._disposed=!1}return b.prototype.dispose=function(){this._disposed=!0},b.prototype.init=function(a){var b=a.workflows[0];b.addHandler(b.stepEvents.requestEnd,this.onPreFetchUrlFormat,this)},b.prototype.onPreFetchUrlFormat=function(b){a.Log.verbose(6,"OnPreFetchUrlFormat"),b.currentModuleId=this._moduleId;var c=this;return new Promise(function(d,e){if(c._disposed)return a.Failure.attachFailureToRequest(b,b.currentModuleId,0),void e("object is already disposed.");if(!b.sessionContext.heuristicSettings.preFetchDataEnabled)return void d();var f=b.sessionContext.commonPresentation.periods[0].streams,g=f.findFirst(function(a){return 0===a.type});if(b.requestedStream=g,!b.requestedStream)return void d();var h=c.getBitrate(b);if(!h)throw new Error("bitrate of video track not set in presentation");var i=b.requestedStream.mediaUrlTemplate;if(!i)throw new Error("media url template is not set for the video stream");var j,k=g.segments;j=b.sessionContext.commonPresentation.isLive?k.last.segmentInfo:k.first.segmentInfo;var l=a.Util.UrlFormatter.FormatDashMediaUrl(i,h.toString(),j.mediaTimestampStr,b.sessionContext.presentationQueryStr),m=new a.Context.UrlRequest(l,3,0,g.id,h,j.presTimeInSec,j.durationInSec);b.urlsToRetrieve.push(m),b.sessionContext.heuristicSettings.preFetchDataEnabled=!1,d()})},b.prototype.getBitrate=function(a){var b=Math.max(a.sessionContext.videoTag.scrollWidth,a.sessionContext.videoTag.width),c=Math.max(a.sessionContext.videoTag.scrollHeight,a.sessionContext.videoTag.height),d=0;if(c>0&&b>0){for(var e=a.requestedStream.tracks,f=0,g=0,h=0;hb&&e[h].height>c||d&&f===e[h].width&&g===e[h].height))d=e[h].bitrate,f=e[h].width,g=e[h].height;else if(d)break;if(0==d){for(var h=e.length-1;h>=0&&(e[h].selectable&&(e[h].width>b||e[h].height>c));h--)d=e[h].bitrate;0==d&&e.length>0&&(d=e[e.length-1].bitrate)}}if(0==d)if(a.sessionContext.heuristicSettings.preFetchDataMiddle){var i;i=Math.round(a.requestedStream.tracks.length/2)-1,d=a.requestedStream.tracks[i].bitrate}else d=a.requestedStream.tracks[0].bitrate;return d},b}();b.InitialBandwidthDataUrlFormatter=d}(a.Heuristics||(a.Heuristics={}));a.Heuristics}(AzureHtml5JS||(AzureHtml5JS={}));var AzureHtml5JS;!function(a){!function(b){"use strict";var c=function(){function b(){this._moduleId="streamSelector",this._disposed=!1,this._initial=!0}return b.prototype.dispose=function(){this._disposed=!0},b.prototype.init=function(a){var b=a.workflows[0];b.addHandler(b.stepEvents.requestEnd,this.onSelectStreams,this)},b.prototype.onSelectStreams=function(b){var c=this;return b.currentModuleId=this._moduleId,new Promise(function(d,e){var f=!1,g=!1,h=!1,i=null,j=!1,k=b.sessionContext.commonPresentation;if(c._disposed)return a.Failure.attachFailureToRequest(b,b.currentModuleId,0),void e("Disposed");if(!c._initial)return void d();if(!k)throw new Error("CommonPresentation is empty");k.periods[0].streams.forEach(function(a){a.streamingInfo.selected=!1});for(var l=k.periods[0].streams.length-1;l>=0;l--)0!==k.periods[0].streams[l].type||f?1===k.periods[0].streams[l].type?(k.periods[0].streams[l].streamingInfo.supported=MediaSource.isTypeSupported&&MediaSource.isTypeSupported(k.periods[0].streams[l].codec)||k.periods[0].streams[l].codec.indexOf("aac")>-1||k.periods[0].streams[l].codec.indexOf("mp4a")>-1,g&&h||!k.periods[0].streams[l].streamingInfo.supported||(g?!h&&k.periods[0].streams[l].codec.indexOf("ec-3")>-1&&(h=!0,null!==i&&(i.streamingInfo.selected=!1),k.periods[0].streams[l].streamingInfo.selected=!0):(g=!0,k.periods[0].streams[l].streamingInfo.selected=!0,i=k.periods[0].streams[l],k.periods[0].streams[l].codec.indexOf("ec-3")>-1&&(h=!0)))):2!==k.periods[0].streams[l].type||j||(j=!0,k.periods[0].streams[l].streamingInfo.selected=!0):(f=!0,k.periods[0].streams[l].streamingInfo.selected=!0);return f||g?(c._initial=!1,void d()):(a.Failure.attachFailureToRequest(b,b.currentModuleId,4194307),void e("Neither video nor audio streams are found"))})},b}();b.InitialStreamSelector=c}(a.Presentation||(a.Presentation={}));a.Presentation}(AzureHtml5JS||(AzureHtml5JS={}));var AzureHtml5JS;!function(a){!function(b){"use strict";var c=function(){function a(a,b,c,d,e){this.index=a,this._timescale=e,this._presentationOffset=d,this._mediaTimestampStr=b,this._mediaTimestamp=parseInt(b),this._presTimeInSec=(this._mediaTimestamp+d)/e,c&&(this._mediaDuration=c,this._durationInSec=c/e)}return Object.defineProperty(a.prototype,"timescale",{get:function(){return this._timescale},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"presentationOffset",{get:function(){return this._presentationOffset},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"mediaTimestampStr",{get:function(){return this._mediaTimestampStr},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"mediaTimestamp",{get:function(){return this._mediaTimestamp},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"mediaDuration",{get:function(){return this._mediaDuration},set:function(a){this._mediaDuration=a,this._durationInSec=a/this._timescale},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"presTimeInSec",{get:function(){return this._presTimeInSec},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"durationInSec",{get:function(){return this._durationInSec},enumerable:!0,configurable:!0}),a.prototype.update=function(a,b){a&&(this.index+=a),this._presentationOffset!==b&&(this._presentationOffset=b,this._presTimeInSec=(this._mediaTimestamp+b)/this._timescale)},a}();b.MediaSegmentInfo=c;var d=function(){function a(a,b,d,e,f,g){this.firstSegment=new c(a,b,d,e,f),this.repeat=g,this.containerIndex=0/0}return a}();b.SegmentRunEntry=d;var e=function(){function b(b,d,e){this._container=b,this._pubTime=b.pubTime,this._runEntry=d,this._runEntryRepeatPosition=e;var f=d.firstSegment.mediaTimestampStr;e&&(f=a.Timestamp.add(f,e*d.firstSegment.mediaDuration)),this.segmentInfo=new c(d.firstSegment.index+e,f,d.firstSegment.mediaDuration,b.presentationTimeOffset,b.timescale)}return b.prototype.dispose=function(){this.segmentInfo=null,this._container=null,this._pubTime=null,this._runEntry=null,this._runEntryRepeatPosition=0/0},Object.defineProperty(b.prototype,"next",{get:function(){if(this._updateIterator(),isNaN(this._runEntryRepeatPosition))return null;var c=this._runEntry,d=0;if(this._runEntryRepeatPosition+1>this._runEntry.repeat){var e=this._runEntry.containerIndex+1;if(!(e=0&&ethis._pubTime.getTime()){this._pubTime=this._container.pubTime;for(var b=this._runEntry.containerIndex,c=this._container.segmentTable[b];!c&&b>0;)b--,c=this._container.segmentTable[b];if(c){if(c.firstSegment.index<=this.segmentInfo.index&&this.segmentInfo.index<=c.firstSegment.index+c.repeat)return this._runEntry=c,this._runEntryRepeatPosition=this.segmentInfo.index-c.firstSegment.index,void this._updateInfo();if(this.segmentInfo.index>c.firstSegment.index+c.repeat&&this._container.segmentTable.length>b+1){var d=this._container.segmentTable[b+1];if(this.segmentInfo.index<=d.firstSegment.index+d.repeat)return this._runEntry=d,this._runEntryRepeatPosition=this.segmentInfo.index-d.firstSegment.index,void this._updateInfo()}}var e=this._container.getByIndex(this.segmentInfo.index);if(!e)return a.Log.warning(4,"Referenced segment not found in presentation, disposing iterator"),void this.dispose();this._runEntry=e._runEntry,this._runEntryRepeatPosition=e._runEntryRepeatPosition,this._updateInfo()}},b.prototype._updateInfo=function(){var a=this._container.getByIndex(this.segmentInfo.index);if(a){var b=a.segmentInfo;(this.segmentInfo.mediaTimestampStr!==b.mediaTimestampStr||this.segmentInfo.mediaDuration!==b.mediaDuration)&&(this.segmentInfo=new c(b.index,b.mediaTimestampStr,b.mediaDuration,b.presentationOffset,b.timescale)); }},b}();b.MediaSegmentInfoIterator=e;var f=function(){function c(a,b,c,d){this.maxSegmentDuration=0,this.timescale=a,this.presentationTimeOffset=b,this.pubTime=c,this.segmentTable=[],this._isLive=d}return c.prototype.dispose=function(){this.segmentTable.length=0},Object.defineProperty(c.prototype,"first",{get:function(){var a=null;return this.segmentTable.length>0&&(a=new e(this,this.segmentTable[0],0)),a},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"last",{get:function(){var a,b=null;return this.segmentTable.length>0&&(a=this.segmentTable[this.segmentTable.length-1],b=new e(this,a,a.repeat)),b},enumerable:!0,configurable:!0}),c.prototype.addMediaSegmentRun=function(b){var c=null,e=0;if(this.segmentTable.length>0){c=this.segmentTable[this.segmentTable.length-1],e=c.firstSegment.mediaTimestamp+c.firstSegment.mediaDuration*(c.repeat+1);var f=a.Common.timestampDeltaThreshold*this.timescale;if(e-b.firstSegment.mediaTimestamp>f)if(0===b.repeat)a.Log.warning(4,"Discontinuities detected at: "+b.firstSegment.mediaTimestamp);else{var g,h=b.firstSegment;for(g=1;g<=b.repeat;g++){var i=h.mediaTimestamp+h.mediaDuration*g;if(!(e>i)){var j=new d(h.index,i.toString(),h.mediaDuration,h.presentationOffset,h.timescale,b.repeat-g);b=j;break}}}}return b?(b.containerIndex=this.segmentTable.length,this.segmentTable.push(b),this.maxSegmentDuration=Math.max(this.maxSegmentDuration,b.firstSegment.durationInSec||0),a.Log.verbose(4,"Added segment with idx="+b.firstSegment.index+" mt="+b.firstSegment.mediaTimestamp+" pt="+b.firstSegment.presTimeInSec.toFixed(7)+" r="+b.repeat+(b.firstSegment.durationInSec?" d="+b.firstSegment.durationInSec.toFixed(7):"")),b.repeat+1):0},c.prototype.addMediaSegmentInfo=function(a,c,d,e,f){var g;if(this.segmentTable.length>0&&0/0===this.segmentTable[this.segmentTable.length-1].firstSegment.mediaDuration)throw new Error("Failed to add segment: previous entry doesn't have duration");g=new b.SegmentRunEntry(a,c,d,e,f,0),this.addMediaSegmentRun(g)},c.prototype.updateSegmentDuration=function(b,c){var d,e;if(0===this.segmentTable.length)return!1;if(d=this.segmentTable[this.segmentTable.length-1],d.firstSegment.presTimeInSec!==b){if(e=a.Common.binarySearch(b,this.segmentTable,this._compareTimestampInSec),-1===e)return a.Log.verbose(4,"Failed to update segment duration, run entry with presentation time "+b+" not found"),!1;d=this.segmentTable[e]}return d.firstSegment.mediaDuration!==c&&(a.assert(!d.firstSegment.mediaDuration&&0===d.repeat,"Failed to update segment duration, run entry (s:"+d.firstSegment.presTimeInSec+" d:"+d.firstSegment.durationInSec+" r:"+d.repeat+") cannot be overwritten by segment (s:"+b+" d:"+c/this.timescale+")"),d.firstSegment.mediaDuration=c),this.maxSegmentDuration=Math.max(this.maxSegmentDuration,d.firstSegment.durationInSec||0),!0},c.prototype.getByIndex=function(b){var c,d=null;if(0===this.segmentTable.length)return null;if(c=a.Common.binarySearch(b,this.segmentTable,this._compareIndex),-1!==c){var f=this.segmentTable[c],g=b-f.firstSegment.index;d=new e(this,f,g)}return d||a.Log.verbose(4,"Entry with index "+b+" not found"),d},c.prototype.getBySegmentStartTime=function(b,c){var d,f=null;if(0===this.segmentTable.length)return null;if(c||(c=a.Common.timestampDeltaThreshold),Math.abs(b-this.segmentTable[0].firstSegment.presTimeInSec)g.repeat){if(!(d+1c)return a.Log.verbose(4,"Cannot find match within error range for "+b),null;f=new e(this,g,h)}return f},c.prototype.getByInSegmentTimestamp=function(b){var c,d=null;if(0===this.segmentTable.length)return null;if(c=a.Common.binarySearch(b,this.segmentTable,this._compareTimestampInSec),-1===c&&this._isLive&&bb||b>=this._commonStream.tracks.length)&&(a.Log.warning(7,"selectTrackByIndex: "+b+" switching back to auto track selection"),b=-1),a.Log.verbose(7,"selectTrackByIndex: "+b);for(var d=0;d=this.streams.length||0>b)return a.Log.error(7,"switchIndex failed - tried to enable invalid index: "+b),this._eventMgr.dispatchEvent(a.StreamListEventName.streamindexinvalid),!1;var c=this._streams[this.enabledIndices[0]],d=this._streams[b];if(b===this.enabledIndices[0])return a.Log.verbose(7,"switchIndex failed - current stream selected"),this._eventMgr.dispatchEvent(a.StreamListEventName.streamselected),!1;if(d.codec!==c.codec&&!c.hasAudioTypeChangeSupport())return a.Log.verbose(7,"switchIndex failed - switch involves codec change but no changeType support"),this._eventMgr.dispatchEvent(a.StreamListEventName.streamselectnotsupported),!1;this._switchEnabledIndex(b);var e=this._sessionContext.videoTag.currentTime,f=this._sessionContext.prerollBufferInSec();return d.swapBuffersAndCleanUp(c,e,f),d.codec!==c.codec&&(this._sessionContext.eventMgr.dispatchEvent(a.InternalEventName.audiocodecchanged)||a.Log.verbose(7,"switchIndex failed - audiocodecchanged event handler failed")),this._eventMgr.dispatchEvent(a.StreamListEventName.streamselected),!0},b.prototype.addEventListener=function(a,b,c){this._eventMgr.addHandler(a,b,c)},b.prototype.removeEventListener=function(a,b){this._eventMgr.removeHandler(a,b)},b.prototype._switchEnabledIndex=function(b){a.assert(1==this.enabledIndices.length,"Current implementation only allows one enabled stream at a time");var c=this.enabledIndices[0];this._streams[c].enabled=!1,this._streams[b].enabled=!0},b}();b.AudioStreamList=l;var m=function(){function b(a,b){this._commonStream=b}return b.prototype.dispose=function(){this._commonStream=null},Object.defineProperty(b.prototype,"enabled",{get:function(){return this._commonStream.streamingInfo.selected},set:function(a){this._commonStream.streamingInfo.selected=a},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"supported",{get:function(){return this._commonStream.streamingInfo.supported},set:function(a){this._commonStream.streamingInfo.supported=a},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"name",{get:function(){var b=this._commonStream.mediaUrlTemplate.toLowerCase(),c="fragments(",d=b.indexOf(c),e=b.indexOf("=",d);return a.assert(e>d+c.length,"mediaUrlTemplate ("+b+") did not follow expected schema"),this._commonStream.mediaUrlTemplate.substring(d+c.length,e)},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"language",{get:function(){return this._commonStream.language},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"codec",{get:function(){return this._commonStream.codec},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"bitrate",{get:function(){return this._commonStream.tracks[0].bitrate},enumerable:!0,configurable:!0}),b.prototype.hasAudioTypeChangeSupport=function(){return null!==this._commonStream.streamingInfo.sourceBuffer?a.Common.isSafari?!1:this._commonStream.streamingInfo.sourceBuffer.hasAudioTypeChangeSupport:!0},b.prototype.swapBuffersAndCleanUp=function(b,c,d){if(b._commonStream.streamingInfo.sourceBuffer){this._commonStream.streamingInfo.sourceBuffer||(this._commonStream.streamingInfo.sourceBuffer=b._commonStream.streamingInfo.sourceBuffer);var e=this._commonStream.streamingInfo.sourceBuffer;this._commonStream.streamingInfo.workflowState=0,b._commonStream.streamingInfo.workflowState=2,this._commonStream.streamingInfo.pendingSeekPositionInSec=c,this._commonStream.streamingInfo.audioTrackSwitched=!0,e.buffered.length>0&&e.buffered.end(e.buffered.length-1)>c+d&&e.flushFrom(c+d);try{e.flushUntil(c)}catch(f){a.Log.error(7,f)}}},b}()}(a.Presentation||(a.Presentation={}));a.Presentation}(AzureHtml5JS||(AzureHtml5JS={}));var AzureHtml5JS;!function(a){!function(b){"use strict";var c=function(){function b(){this._moduleId="SegmentLocator.Dash",this._disposed=!1}return b.prototype.init=function(a){var b=a.workflows[1];b.addHandler(b.stepEvents.requestBegin,this.onFindSegment,this)},b.prototype.dispose=function(){this._disposed=!0},b.prototype.onFindSegment=function(c){var d="unknown";c.requestedStream&&(d=0===c.requestedStream.type?"video":1===c.requestedStream.type?"audio":"text"),a.Log.verbose(9,"onFindSegment:"+d),c.currentModuleId=this._moduleId;var e=this;return new Promise(function(f,g){if(e._disposed)return a.Failure.attachFailureToRequest(c,c.currentModuleId,0),void g("object is already disposed.");var h=c.requestedStream,i=h.streamingInfo.currentSegment,j=h.segments;if(c.selectedSegment)return void f();if(null!==h.streamingInfo.pendingSeekPositionInSec)a.Log.verbose(9,"onFindSegment("+d+"): pendingSeekPositionInSec "+h.streamingInfo.pendingSeekPositionInSec),h.streamingInfo.currentSegment=j.getByInSegmentTimestamp(h.streamingInfo.pendingSeekPositionInSec),h.streamingInfo.currentSegment?(a.Log.verbose(9,"found segment "+h.streamingInfo.currentSegment.segmentInfo.presTimeInSec+" for seek position "+h.streamingInfo.pendingSeekPositionInSec),h.streamingInfo.pendingSeekPositionInSec=null,c.requestedStream.streamingInfo.fetchInitSegment=!0):(a.Log.verbose(9,"onFindSegment: didn't find the segment in container. Trying other methods."),c.sessionContext.isLiveToVod&&(h.streamingInfo.pendingSeekPositionInSec=c.sessionContext.commonPresentation.playableWindow.endInSec-.01));else if(i)h.streamingInfo.currentSegment=i.next;else{var k=c.sessionContext;isNaN(k.startPositionInSec)?h.streamingInfo.currentSegment=j.first:(h.streamingInfo.currentSegment=j.getByInSegmentTimestamp(k.startPositionInSec),!h.streamingInfo.currentSegment&&k.startPositionInSecj.last.segmentInfo.presTimeInSec&&(h.streamingInfo.currentSegment=j.last))}if(null===h.streamingInfo.currentSegment)if(c.sessionContext.commonPresentation.isLive&&i&&i.segmentInfo&&(i.segmentInfo.mediaTimestamp>=j.last.segmentInfo.mediaTimestamp||h.streamingInfo.pendingSeekPositionInSec)){if(a.Log.warning(9,"Unable to find a segment"),h.streamingInfo.currentSegment=i,!c.sessionContext.commonPresentation.minimumUpdatePeriodInSec)return h.streamingInfo.audioTrackSwitched=!1,a.Failure.attachFailureToRequest(c,c.currentModuleId,1),void g();c.state=2,c.retryWaitTimeMSec=b._retryWaitTimeMSec,a.Log.verbose(9,"Reverting to previous segment")}else{if((h.streamingInfo.audioTrackSwitched||i&&!i.segmentInfo)&&c.sessionContext.commonPresentation.isLive)return h.streamingInfo.audioTrackSwitched=!1,a.Failure.attachFailureToRequest(c,c.currentModuleId,1),void g();c.state=1}f()})},b._retryWaitTimeMSec=2e3,b}();b.Dash=c}(a.SegmentLocator||(a.SegmentLocator={}));a.SegmentLocator}(AzureHtml5JS||(AzureHtml5JS={}));var AzureHtml5JS;!function(a){!function(b){"use strict";var c=function(){function b(a){this._adSignals=[],this._adSignalsSeen={},this._eventManager=a}return b.prototype.reset=function(){this._adSignals=[],this._adSignalsSeen={}},b.prototype.getAdSignalsAndReset=function(){var a=this._adSignals;return this._adSignals=[],a},b.prototype.addAdSignals=function(b){for(var c=b&&b.length>0&&!!b[0].simpleSignal,d=[],e=0;e0&&(this._adSignals=this._adSignals.concat(d),this._eventManager.dispatchEvent(a.EventName.spliceWaiting))},b.prototype.checkSignalHasBeenSeenBefore=function(b){var c;return c=b.simpleSignal?b.simpleSignal.id+","+b.simpleSignal.duration+","+b.simpleSignal.presentationTime:b.scteSignal.signalInString+(b.scteSignal.presentationTimeOverride?b.scteSignal.presentationTimeOverride:0),this._adSignalsSeen[c]?(a.Log.verbose(15,"ADSIGNAL: Redundant ad signal: "+c+", ignoring..."),!0):(this._adSignalsSeen[c]=!0,!1)},b}();b.Manager=c}(a.Ad||(a.Ad={}));a.Ad}(AzureHtml5JS||(AzureHtml5JS={}));var AzureHtml5JS;!function(a){!function(b){function c(b,c){if(!c||0===c.length)return!0;try{var d=decodeURIComponent(c)}catch(e){return a.Log.error(12,e),!1}var f="urn:microsoft:azure:mediaservices:keyacquisitionhostname",g=d.indexOf(f);if(-1===g)return!0;var h=d.indexOf("&",g);-1===h&&(h=d.length);var i=d.substring(g,h),j=i.split("=");if(2!=j.length)return a.Log.error(12,"AMS hostname token is malformed: "+i),!1;var k=document.createElement("a");return k.href=b,j[1].toLowerCase()!=k.hostname.toLowerCase()?(a.Log.error(12,"AMS hostname mismatch: "+j[1].toLowerCase()+", "+k.hostname.toLowerCase()),!1):!0}b.verifyKeyUrlWithToken=c}(a.AesUtil||(a.AesUtil={}));a.AesUtil}(AzureHtml5JS||(AzureHtml5JS={})),Object.defineProperty(Array.prototype,"findFirst",{value:function(a){for(var b=0;b=0;b--){var c=this[b];if(a.call(this,c,b,Object(this)))return c}return null},enumerable:!1,configurable:!0}),Object.defineProperty(Array.prototype,"findIndexOf",{value:function(a){for(var b=0;be;e++)d[e-a]=c[e];return d.buffer},ArrayBuffer.prototype.slice=ArrayBuffer.prototype.slice||ArrayBuffer.prototype.polyfill_slice);var AzureHtml5JS;!function(a){"use strict";function b(a,b){if(!a)throw new Error(b)}a.assert=b}(AzureHtml5JS||(AzureHtml5JS={}));var AzureHtml5JS;!function(a){!function(a){"use strict";var b=function(){function a(a,b){if(this.dropOldestKeepAtLeastOne=function(){this._slidingWindow.length>1&&this.dropOldest()},this._slidingWindow=[],this._sum=0,this._minWindowLength=a,this._maxWindowLength=b,0>a||1>b||a>b)throw new Error("window length for average class should be greater than 0")}return a.prototype.dispose=function(){this._slidingWindow=null},Object.defineProperty(a.prototype,"average",{get:function(){return 0===this._slidingWindow.length||this._slidingWindow.length=this._maxWindowLength&&this.dropOldest(),this._slidingWindow.push(a),this._sum+=a},a.prototype.dropOldest=function(){if(this._slidingWindow.length>0){var a=this._slidingWindow.splice(0,1);a[0]!=1/0?this._sum-=a[0]:this._sum=this._slidingWindow.reduce(function(a,b){return a+b})}},a}();a.AverageCalculator=b}(a.Util||(a.Util={}));a.Util}(AzureHtml5JS||(AzureHtml5JS={}));var AzureHtml5JS;!function(a){!function(b){"use strict";function c(){var a=/.*Mac OS X (\d+)_(\d+)_*.*\).*/.exec(navigator.userAgent);if(a&&3===a.length){var b=parseInt(a[1],10),c=parseInt(a[2],10);return 10==b&&11>=c||10>b}return!1}function d(a,c,d){"undefined"==typeof d&&(d=b.timestampDeltaThreshold);var e=c-a;return Math.abs(e)=d;){f=Math.floor((d+e)/2);var g=c(a,b[f]);if(0>g)e=f-1;else{if(!(g>0))return f;d=f+1}}return-1}function f(a,b,c){var d=0,e=b.length-1,f=0;if(0>=e)return-1;for(;e>=d;){if(f=Math.floor((d+e)/2),0===f)return c(a,b[d],b[e])?-1:1;var g=c(a,b[f-1],b[f]);if(0>g)e=f-1;else{if(!(g>0))return f;d=f+1}}return-1}function g(a,b,c){var d=0,e=b.length-1,f=0;if(0>e)return-1;if(0===e)return c(a,b[0]);for(;e>=d;){if(f=Math.floor((d+e)/2),0===f)return c(a,b[d],b[e]);var g=c(a,b[f-1],b[f]);if(0>g)e=f-1;else{if(!(g>0))return f-1;d=f+1}}return b.length-1}function h(a){for(var b="",c=0;ca&&(a=4294967295+a+1),"0x"+("00000000"+a.toString(16).toUpperCase()).substr(-8)}function k(a){for(var b="",c=0;ca)for(var d=0;d=0||b.diffTimes(c,e)>=0||(b.diffTimes(e,a)>=0&&b.diffTimes(a,f)>=0&&b.diffTimes(f,c)>=0?this._timeRanges[d].endInSec=a:b.diffTimes(e,a)>=0&&b.diffTimes(c,f)>=0?(this._timeRanges[d].endInSec=a,this._timeRanges.splice(d+1,0,new p(c,f))):b.diffTimes(a,e)>=0&&b.diffTimes(f,c)>=0?(this._timeRanges.splice(d,1),--d):b.diffTimes(a,e)>=0&&b.diffTimes(e,c)>=0&&b.diffTimes(c,f)>=0&&(this._timeRanges[d].startInSec=c),b.diffTimes(this._timeRanges[d].endInSec,this._timeRanges[d].startInSec)>=0&&(this._timeRanges.splice(d,1),--d))}},a.prototype.rebase=function(a){this._timeRanges.forEach(function(b){b.startInSec-=a,b.endInSec-=a})},a.prototype.removeGaps=function(a){for(var b=0;b+1=this._timeRanges.length)return-2;var d=this._timeRanges[b+1];if(c.endInSec<=a&&a<=d.startInSec)return b+1}return-1},a.prototype.beforeDiscontinuity=function(a,c){return 0>c||c+1>=this._timeRanges.length||this._timeRanges[c].startInSec>a||a>=this._timeRanges[c].endInSec?!1:0!==d(this._timeRanges[c].endInSec,this._timeRanges[c+1].startInSec)&&this._timeRanges[c].endInSec-a=c||c>=this._timeRanges.length||this._timeRanges[c-1].endInSec>a||a>=this._timeRanges[c].endInSec?!1:0!==d(this._timeRanges[c-1].endInSec,this._timeRanges[c].startInSec)&&(ac;c++)b[c]=this.getUint8();return b},a.prototype.readString=function(a){for(var b="",c=0;a>c;c++)b+=String.fromCharCode(this.getUint8());return b},a.prototype.readStringUntilEnd=function(){for(var a="",b=0;this.readPos=400&&600>a?2097152|a:2097152}function d(a){var b="";return a.filename&&(b+=" file: "+a.filename),a.lineno&&(b+=" line: "+a.lineno),a.colno&&(b+=" colno: "+a.colno),a.error&&(b+="error: "+a.error),a.message&&(b+="msg: "+a.message),b}function e(b){if(void 0===b||null===b)return"undefined";var c=g(b.code);return b.msExtendedCode&&(c+=", msErrorCode: "+a.Common.toHexString(b.msExtendedCode)),c}function f(a,b,c,d){var e=new i(b,c,d);null!=a&&(a.externalFailure=e)}function g(a){switch(a){case MediaError.MEDIA_ERR_ABORTED:return"MEDIA_ERR_ABORTED";case MediaError.MEDIA_ERR_NETWORK:return"MEDIA_ERR_NETWORK";case MediaError.MEDIA_ERR_DECODE:return"MEDIA_ERR_DECODE";case MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED:return"MEDIA_ERR_SRC_NOT_SUPPORTED";default:return a.toString()}}function h(a){return a>1048575}var i=function(){function b(a,b,c){this.originModuleId=a,this.code=b,this.message=c}return b.prototype.dispose=function(){this.originModuleId=null,this.code=null,this.message=null},b.prototype.toString=function(){var b;return b="Module = "+this.originModuleId+" FailureCode = "+a.Common.toHexString(this.code),this.message&&(b+=" "+this.message),b},b}();b.Record=i,b.translateHttpStatusToCode=c,b.errorEventToString=d,b.mediaErrorToString=e,b.attachFailureToRequest=f,b.isExternalError=h;var j=function(){function b(a,b){a?(this.code=a,this.message=b):(this.code=0,this.message=null)}return b.prototype.translateMediaError=function(b){this.code=b.code<<20,b.msExtendedCode&&(this.message="msErrorCode: "+a.Common.toHexString(b.msExtendedCode));var c=b.message;c&&c.length&&(this.message=this.message?this.message+" "+c:c)},b.prototype.toString=function(){var b="code: "+a.Common.toHexString(this.code);return this.message&&(b+=", msg: "+this.message),b},b}();b.External=j}(a.Failure||(a.Failure={}));a.Failure}(AzureHtml5JS||(AzureHtml5JS={}));var AzureHtml5JS;!function(a){!function(a){"use strict";a.forgeScript='(function(){function n(n){function i(n){var r,u;if(this.data="",this.read=0,typeof n=="string")this.data=n;else if(t.isArrayBuffer(n)||t.isArrayBufferView(n)){r=new Uint8Array(n);try{this.data=String.fromCharCode.apply(null,r)}catch(f){for(u=0;ur&&(this.data.substr(0,1),this._constructedStringLength=0)};t.ByteStringBuffer.prototype.length=function(){return this.data.length-this.read};t.ByteStringBuffer.prototype.isEmpty=function(){return this.length()<=0};t.ByteStringBuffer.prototype.putByte=function(n){return this.putBytes(String.fromCharCode(n))};t.ByteStringBuffer.prototype.fillWithByte=function(n,t){n=String.fromCharCode(n);for(var i=this.data;t>0;)t&1&&(i+=n),t>>>=1,t>0&&(n+=n);return this.data=i,this._optimizeConstructedString(t),this};t.ByteStringBuffer.prototype.putBytes=function(n){return this.data+=n,this._optimizeConstructedString(n.length),this};t.ByteStringBuffer.prototype.putString=function(n){return this.putBytes(t.encodeUtf8(n))};t.ByteStringBuffer.prototype.putInt16=function(n){return this.putBytes(String.fromCharCode(n>>8&255)+String.fromCharCode(n&255))};t.ByteStringBuffer.prototype.putInt24=function(n){return this.putBytes(String.fromCharCode(n>>16&255)+String.fromCharCode(n>>8&255)+String.fromCharCode(n&255))};t.ByteStringBuffer.prototype.putInt32=function(n){return this.putBytes(String.fromCharCode(n>>24&255)+String.fromCharCode(n>>16&255)+String.fromCharCode(n>>8&255)+String.fromCharCode(n&255))};t.ByteStringBuffer.prototype.putInt16Le=function(n){return this.putBytes(String.fromCharCode(n&255)+String.fromCharCode(n>>8&255))};t.ByteStringBuffer.prototype.putInt24Le=function(n){return this.putBytes(String.fromCharCode(n&255)+String.fromCharCode(n>>8&255)+String.fromCharCode(n>>16&255))};t.ByteStringBuffer.prototype.putInt32Le=function(n){return this.putBytes(String.fromCharCode(n&255)+String.fromCharCode(n>>8&255)+String.fromCharCode(n>>16&255)+String.fromCharCode(n>>24&255))};t.ByteStringBuffer.prototype.putInt=function(n,t){var i="";do t-=8,i+=String.fromCharCode(n>>t&255);while(t>0);return this.putBytes(i)};t.ByteStringBuffer.prototype.putSignedInt=function(n,t){return n<0&&(n+=2<0);return t};t.ByteStringBuffer.prototype.getSignedInt=function(n){var t=this.getInt(n),i=2<=i&&(t-=i<<1),t};t.ByteStringBuffer.prototype.getBytes=function(n){var t;return n?(n=Math.min(this.length(),n),t=this.data.slice(this.read,this.read+n),this.read+=n):n===0?t="":(t=this.read===0?this.data:this.data.slice(this.read),this.clear()),t};t.ByteStringBuffer.prototype.bytes=function(n){return typeof n=="undefined"?this.data.slice(this.read):this.data.slice(this.read,this.read+n)};t.ByteStringBuffer.prototype.at=function(n){return this.data.charCodeAt(this.read+n)};t.ByteStringBuffer.prototype.setAt=function(n,t){return this.data=this.data.substr(0,this.read+n)+String.fromCharCode(t)+this.data.substr(this.read+n+1),this};t.ByteStringBuffer.prototype.last=function(){return this.data.charCodeAt(this.data.length-1)};t.ByteStringBuffer.prototype.copy=function(){var n=t.createBuffer(this.data);return n.read=this.read,n};t.ByteStringBuffer.prototype.compact=function(){return this.read>0&&(this.data=this.data.slice(this.read),this.read=0),this};t.ByteStringBuffer.prototype.clear=function(){return this.data="",this.read=0,this};t.ByteStringBuffer.prototype.truncate=function(n){var t=Math.max(0,this.length()-n);return this.data=this.data.substr(this.read,t),this.read=0,this};t.ByteStringBuffer.prototype.toHex=function(){for(var i,n="",t=this.read;t4)for(r=t,t=n.util.createBuffer(),i=0;i0))return!0;for(r=0;r0))return!0;for(r=0;r0)return!1;var r=n.length(),i=n.at(r-1);return i>this.blockSize<<2?!1:(n.truncate(i),!0)}}return typeof forge=="undefined"&&(forge={}),n(forge)}(),function(){function n(n){function l(t,i){var r=function(){return new n.aes.Algorithm(t,i)};n.cipher.registerAlgorithm(t,r)}function h(){var u,o,c,l,w,a,h,b,v,y,n,p;for(f=!0,s=[0,1,2,4,8,16,32,64,128,27,54],u=new Array(256),n=0;n<128;++n)u[n]=n<<1,u[n+128]=n+128<<1^283;for(t=new Array(256),e=new Array(256),r=new Array(4),i=new Array(4),n=0;n<4;++n)r[n]=new Array(256),i[n]=new Array(256);for(o=0,c=0,n=0;n<256;++n){for(h=c^c<<1^c<<2^c<<3^c<<4,h=h>>8^h&255^99,t[o]=h,e[h]=o,b=u[h],l=u[o],w=u[l],a=u[w],v=b<<24^h<<16^h<<8^h^b,y=(l^w^a)<<24^(o^a)<<16^(o^w^a)<<8^o^l^a,p=0;p<4;++p)r[p][o]=v,i[p][h]=y,v=v<<24|v>>>8,y=y<<24|y>>>8;o===0?o=c=1:(o=l^u[u[u[l^a]]],c^=u[u[c]])}}function c(n,r){for(var h,y,e=n.slice(0),o,p=1,c=e.length,w=c+6+1,a=u*w,f=c;f>>16&255]<<24^t[o>>>8&255]<<16^t[o&255]<<8^t[o>>>24]^s[p]<<24,p++):c>6&&f%c==4&&(o=t[o>>>24]<<24^t[o>>>16&255]<<16^t[o>>>8&255]<<8^t[o&255]),e[f]=e[f-c]^o;if(r){var v,b=i[0],k=i[1],d=i[2],g=i[3],l=e.slice(0);for(a=e.length,f=0,h=a-u;f>>24]]^k[t[v>>>16&255]]^d[t[v>>>8&255]]^g[t[v&255]];e=l}return e}function o(n,u,f,o){var tt=n.length/4-1,y,p,w,b,s,h,c,l,a,d,g,nt,v,k;for(o?(y=i[0],p=i[1],w=i[2],b=i[3],s=e):(y=r[0],p=r[1],w=r[2],b=r[3],s=t),h=u[0]^n[0],c=u[o?3:1]^n[1],l=u[2]^n[2],a=u[o?1:3]^n[3],v=3,k=1;k>>24]^p[c>>>16&255]^w[l>>>8&255]^b[a&255]^n[++v],g=y[c>>>24]^p[l>>>16&255]^w[a>>>8&255]^b[h&255]^n[++v],nt=y[l>>>24]^p[a>>>16&255]^w[h>>>8&255]^b[c&255]^n[++v],a=y[a>>>24]^p[h>>>16&255]^w[c>>>8&255]^b[l&255]^n[++v],h=d,c=g,l=nt;f[0]=s[h>>>24]<<24^s[c>>>16&255]<<16^s[l>>>8&255]<<8^s[a&255]^n[++v];f[o?3:1]=s[c>>>24]<<24^s[l>>>16&255]<<16^s[a>>>8&255]<<8^s[h&255]^n[++v];f[2]=s[l>>>24]<<24^s[a>>>16&255]<<16^s[h>>>8&255]<<8^s[c&255]^n[++v];f[o?1:3]=s[a>>>24]<<24^s[h>>>16&255]<<16^s[c>>>8&255]<<8^s[l&255]^n[++v]}n.aes=n.aes||{};n.aes.Algorithm=function(n,t){f||h();var i=this;i.name=n;i.mode=new t({blockSize:16,cipher:{encrypt:function(n,t){return o(i._w,n,t,!1)},decrypt:function(n,t){return o(i._w,n,t,!0)}}});i._init=!1};n.aes.Algorithm.prototype.initialize=function(t){var i,f,u,r,e,o;if(!this._init){if(i=t.key,typeof i=="string"&&(i.length===16||i.length===24||i.length===32))i=n.util.createBuffer(i);else if(n.util.isArray(i)&&(i.length===16||i.length===24||i.length===32))for(f=i,i=n.util.createBuffer(),r=0;r>>2,r=0;rm&&b.code&&b.code>=a.Failure.translateHttpStatusToCode(500)?(m++,a.Log.warning(13,"Request failed error: "+a.Common.toHexString(b.code)+", number of times tried: "+m+" , retrying the request"),setTimeout(function(){j()},Math.pow(2,m)*f.maxWaitTimeBetweenRetriesMS)):i(b)}var m=0;j()})}function d(b,c,d,e,f){return new Promise(function(g,h){function i(){if(200==k.status)g(k.response);else{var d="";if(null!==k.response){var e=new a.DataViewReaderWriter.Reader(new DataView(k.response));d=e.readStringUntilEnd()}a.Log.error(13,"XHR load failed status:"+k.statusText+"("+k.status+"), expected to be 200, readyState:"+k.readyState+" ("+c+" "+b+"), response:"+d),h({code:a.Failure.translateHttpStatusToCode(k.status),response:d})}}function j(){a.Log.error(13,"XHR failed status: "+k.statusText+" ("+k.status+"), readyState: "+k.readyState),h({code:2097753,response:""})}var k=new a.HttpRequest.XMLHttpRequestWrapper;k.onload=i,k.onerror=j,k.open(c,b),k.responseType=d,e&&e.forEach(function(a){k.setRequestHeader(a.name,a.value)}),f?k.send(f):k.send()})}b.authorizationHeader="Authorization",b.httpRequestWithRetryConfig=c,b.httpRequest=d}(a.HttpUtil||(a.HttpUtil={}));a.HttpUtil}(AzureHtml5JS||(AzureHtml5JS={}));var __extends=this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);c.prototype=b.prototype,a.prototype=new c},AzureHtml5JS;!function(a){!function(b){"use strict";function c(b,c,d){"undefined"==typeof d&&(d=0);var f,g=d;if(!c||4!==c.length)return a.Log.error(11,"Parameter error, box type must have four characters"),null;if(!b||b.byteLength<8)return a.Log.error(11,"Parameter error, not enough data"),null;for(;g0&&f9007199254740991)return a.Log.error(11,"Box size too big for precise representation as Javascript number"),null}else 0===d.size&&(d.size=b.byteLength);if(d.size>b.byteLength-c)return null;if("uuid"===d.type){if(b.byteLength-d.readPosition<16)return a.Log.error(11,"MP4 box parsing error, not enough data for usertype"),null;d.usertype=d.readString(16)}return d.data=new DataView(b.buffer,b.byteOffset+d.readPosition,b.byteLength-d.readPosition),d}function f(b){var d,e=null;return(d=c(b,"tfhd"))?(e=m.parse(d),e||a.Log.warning(11,"Parsing of tfhd failed"),e):(a.Log.warning(11,"tfhd not found"),null)}function g(b){var d,e=null;return(d=c(b,"trun"))?(e=n.parse(d),e||a.Log.warning(11,"Parsing of trun failed"),e):(a.Log.warning(11,"trun not found"),null)}function h(b){var d,e=null;return(d=c(b,"tfdt"))?(e=p.parse(d),e||a.Log.warning(11,"Parsing of tfdt failed"),e):(a.Log.warning(11,"tfdt not found"),null)}function i(b){for(var d,e=[],f=0;f0&&a.Log.verbose(11,"emsg boxes found: "+e.length),e}var k=function(){function b(b,c){b&&"undefined"!=typeof c&&(this.data=b,this.reader=new a.DataViewReaderWriter.Reader(b,c))}return b.prototype.getUint32=function(){return this.reader.getUint32()},b.prototype.getInt32=function(){return this.reader.getInt32()},b.prototype.getUint8=function(){return this.reader.getUint8()},b.prototype.getBytes=function(a){return this.reader.getBytes(a)},b.prototype.getRemainingBytes=function(){return this.reader.getBytes(this.size-this.readPosition)},b.prototype.readString=function(a){return this.reader.readString(a)},b.prototype.readStringUntilEnd=function(){return this.reader.readStringUntilEnd()},b.prototype.readTerminatedString=function(){return this.reader.readTerminatedString()},Object.defineProperty(b.prototype,"readPosition",{get:function(){return this.reader.readPos},enumerable:!0,configurable:!0}),b}();b.Mp4Box=k;var l=function(b){function c(c){b.call(this),c&&(this.size=c.size,this.type=c.type,this.usertype=c.usertype,this.data=c.data,this.reader=new a.DataViewReaderWriter.Reader(this.data),this._versionFlags=c._versionFlags)}return __extends(c,b),c.parse=function(b){var d=null;return b.data.byteLength<4?(a.Log.error(11,"Full box parsing error, not enough bytes"),null):(d=new c,d.size=b.size,d.type=b.type,d.usertype=b.usertype,d._versionFlags=b.data.getUint32(0),d.data=new DataView(b.data.buffer,b.data.byteOffset+4,b.data.byteLength-4),d.reader=new a.DataViewReaderWriter.Reader(d.data),d)},c.serialize=function(b,c){var d=("uuid"===b.type?16:0)+12,e=c+d,f=new ArrayBuffer(e),g=new DataView(f),h=new a.DataViewReaderWriter.Writer(g);if(e>4294967295)throw new Error("Mp4FullBox::serialize, large size is not supported");if(h.setUint32(e),h.setString(b.type),"uuid"===b.type&&h.setString(b.usertype),h.setUint32(b._versionFlags),h.writePos!==d)throw new Error("Mp4FullBox::serialize, inconsistent bytes written");return h},Object.defineProperty(c.prototype,"version",{get:function(){return this._versionFlags>>24},set:function(a){this._versionFlags&=16777215,this._versionFlags|=a<<24},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"flags",{get:function(){return 16777215&this._versionFlags},set:function(a){this._versionFlags&=4278190080,this._versionFlags|=16777215&a},enumerable:!0,configurable:!0}),c.prototype.getUint32Cond=function(a){var b;return a&this.flags&&(b=this.reader.getUint32()),b},c}(k);b.Mp4FullBox=l;var m=function(b){function c(a){b.call(this,a)}return __extends(c,b),c.parse=function(b){var d=null,e=null;return(e=l.parse(b))?(d=new c(e),e.data.byteLength=9007199254740992&&a.Log.warning(11,"tfdt timestamp greater than 53 bits, possible precision loss"),d)):null},c.prototype._calculatedSize=function(){return 1===this.version?8:4},c.typeStr="tfdt",c}(l);b.TfdtBox=p;var q=function(b){function c(a){a?b.call(this,a):this.type=c.typeStr,this._keyIds=[]}return __extends(c,b),c.parse=function(b){var d=null,e=null;if(e=l.parse(b),!e)return null;if(d=new c(e),e.data.byteLength0){if(f=d.getUint32(),d._keyIds.length=f,e.data.byteLengthg;g++){var h=d.getBytes(16);d._keyIds[g]=h}}var i=d.getUint32();return e.data.byteLength0&&(b+=4+16*this._keyIds.length),b},c.prototype.serialize=function(){var a=l.serialize(this,this._calculatedSize(this.specificData.byteLength));if(!this.systemId)throw new Error("systemId is not set");if(a.setBytes(this.systemId),this.version>0&&(a.setUint32(this._keyIds.length),this._keyIds.forEach(function(b){a.setBytes(b)})),!this.specificData)throw new Error("specificData is not set");if(a.setUint32(this.specificData.byteLength),a.setBytes(this.specificData),a.writePos!=a.data.buffer.byteLength)throw new Error("Failed to write to end of buffer");return a.data.buffer},c.typeStr="pssh",c}(l);b.PsshBox=q;var r=function(a){function b(c){c?a.call(this,c):this.type=b.typeStr}return __extends(b,a),b.parse=function(a){var c=null,d=null;if(d=l.parse(a),!d)return null;if(c=new b(d),0===c.version)c.schemeIdUrl=c.readTerminatedString(),c.value=c.readTerminatedString(),c.timescale=c.getUint32(),c.presentationTimeDelta=c.getUint32(),c.eventDuration=c.getUint32(),c.id=c.getUint32();else{if(1!=c.version)return null;c.timescale=c.getUint32(),c.presentationTimePartA=c.getUint32(),c.presentationTimePartB=c.getUint32(),c.eventDuration=c.getUint32(),c.id=c.getUint32(),c.schemeIdUrl=c.readTerminatedString(),c.value=c.readTerminatedString()}return c.messageData=c.getRemainingBytes(),c},b.typeStr="emsg",b}(l);b.EmsgBox=r,b.GetBoxByType=c,b.GetBoxByTypeFromFixedChildren=d,b.GetTfhdBox=f,b.GetTrunBox=g,b.GetTfdtBox=h,b.GetPsshBoxes=i,b.GetEmsgBoxes=j}(a.Mp4Util||(a.Mp4Util={}));a.Mp4Util}(AzureHtml5JS||(AzureHtml5JS={}));var AzureHtml5JS;!function(a){!function(b){"use strict";function c(){return a.VideoElementAdapter.supported()}function d(a){var b=!1;if(a&&a.canPlayType){var c=a.canPlayType("application/vnd.apple.mpegurl");("maybe"===c||"probably"===c)&&(b=!0)}return b}function e(a){var b=!1;if(a&&a.canPlayType){var c=a.canPlayType("video/mp4");("maybe"===c||"probably"===c)&&(b=!0)}return b}!function(a){a[a.type1=1]="type1",a[a.type2=2]="type2",a[a.type3=3]="type3"}(b.Type||(b.Type={}));b.Type;b.MseSupported=c,b.HlsType1Supported=d,b.Mp4Type1Supported=e}(a.PlayerDetector||(a.PlayerDetector={}));a.PlayerDetector}(AzureHtml5JS||(AzureHtml5JS={}));var AzureHtml5JS;!function(a){!function(b){"use strict";function c(a,b){if(a&&a.length>0){var c=a.trim().toLowerCase();if(j[c])return g(j[c],b)}}function d(a,b){var c=a.trim().toLowerCase();if(c.lastIndexOf(".ism/")>-1){var d=f(c);if(h[d])return g(h[d],b)}var j=e(c);return i[j]?g(i[j],b):null}function e(a){var b=null,c=a.lastIndexOf("."),d=a.indexOf("/",c);return c>-1&&(b=a.substring(c+1,-1!==d?d:a.length)),b}function f(a){var b=null,c=a,d="(format=",e=a.lastIndexOf("?");e>-1&&(c=a.substring(0,e));var f=c.lastIndexOf(d);if(f>-1){var g=c.lastIndexOf(")");if(g>f){b=c.substring(f+d.length,g);var h=b.indexOf(",");h>-1&&(b=b.substring(0,h))}}return b}function g(b,c){a.Log.verbose(7,"Using format "+b+" to get player type.");var d=null;switch(b){case 1:a.PlayerDetector.HlsType1Supported(c)?d=1:a.Log.warning(7,"HLS type1 is not supported.");break;case 2:a.PlayerDetector.Mp4Type1Supported(c)?d=1:a.Log.warning(7,"MP4 type1 is not supported.");break;case 3:a.PlayerDetector.MseSupported(c)?d=3:a.Log.warning(7,"MSE is not supported."); }return d}!function(a){a[a.hls=1]="hls",a[a.mp4=2]="mp4",a[a.dash=3]="dash"}(b.Format||(b.Format={}));var h=(b.Format,{"m3u8-aapl-v3":1,"m3u8-aapl-v4":1,"mpd-time-csf":3,"mpd-time-cmaf":3}),i={mp4:2,m3u8:1},j={"video/mp4":2,"application/dash+xml":3,"application/vnd.apple.mpegurl":1};b.getByPresentationType=c,b.getByUrl=d,b._getFileExtension=e,b._getAzureMediaFormatTag=f,b._getPlayerTypeByFormat=g}(a.PlayerType||(a.PlayerType={}));a.PlayerType}(AzureHtml5JS||(AzureHtml5JS={}));var AzureHtml5JS;!function(a){!function(b){"use strict";function c(a){for(var b=0;bc?(e=parseInt(a.slice(0,a.length-c),10),f=parseInt(a.slice(a.length-c),10)):(e=0,f=parseInt(a,10)),f+=b,f>=d){var h=Math.floor(f/d);e+=h,f%=d}var i=f.toString();if(e){g=e.toString();for(var j=0;j0){var h=window.amp.getPlayers(),i=null;if(h&&(i=h[this.playerId])){for(var j=!0,k=g.cues.length-1;k>=0;k--)if(g.cues[k].text){j=!1;break}!j&&this.imsc1Disabled&&(a.Log.verbose(16,"Restarting IMSC1 captions."),i.prepareForImsc1Captions(this.imsc1TrackPreviouslySelected),this.imsc1Disabled=!1);for(var l=1===i.options_.imsc1CaptionsSettings.length,m=i.textTracks(),k=0;k=b.consecutiveEmptyCaptionsThreshold){var p="Empty IMSC1 captions in stream "+c;a.Log.error(16,p),o=0}Date.now()-this.lastNonEmptyTtmlTimestamp>b.emptyCaptionsTimeThreadhold&&(a.Log.verbose(16,"Turning off IMSC1 captions."),this.imsc1TrackPreviouslySelected="showing"===n.mode,i.removeRemoteTextTrack(n),this.imsc1Disabled=!0)}else o=0,this.lastNonEmptyTtmlTimestamp=Date.now();this.consecutiveEmptyTtmlsLookup[c]=o;break}}e.cueDownloadCount++}}}}else a.Log.error(16,"Skipping ttml data. The ttml track is invalid.")},b.prototype.extractTtml=function(b){if(a.Log.verbose(16,"Extracting ttml data"),!b)return a.Log.warning(16,"Media segment: no media data for TTML"),null;var c,d=new DataView(b);return c=a.Mp4Util.GetBoxByType(d,"mdat"),c?c.readStringUntilEnd():(a.Log.warning(16,"mdat not found"),null)},b.prototype.ttmlToCue=function(a){var b=this.domParser.parseFromString(a,"text/xml"),c=this.getLanguage(b),d=b.getElementsByTagName("p"),e=[];if(d.length>0)for(var f=0;f0&&(b=c[0].getAttribute("xml:lang")),b=b||"",b.toLowerCase()},b.prototype.parseTTMLCue=function(a){for(var b=a.getAttribute("begin").split(":"),c=a.getAttribute("end").split(":"),d=this.convertTimeToSeconds(b)+this.normalizedPresentationTimeInSecs,e=this.convertTimeToSeconds(c)+this.normalizedPresentationTimeInSecs,f="",g=0;g0){for(var b=0;b0?d:null}function g(a){var b=a.trim(),c=b.search(/\.ism\/manifest/i);return b.substr(0,c+t.length)}function h(a){var b,c=a.src.trim(),f=c.search(/format=/i),h=[],n="",s="",x=c.indexOf("?");if(-1!==x&&(s=c.substr(x),""!==s)){var y=new RegExp("(\\?|&)protectionType=(.[^&]*)","i"),z=new RegExp("(\\?|&)token=(.[^&]*)","i"),A=s.match(y),B=s.match(z);if(A&&3===A.length){var C=new w;C.type=A[2],B&&3===B.length&&(C.authenticationToken=decodeURIComponent(B[2])),a.protectionInfo=[C]}}var D=c.match(/.*\(format=(.*)\)/),E=!1;if(D&&2===D.length){var F=D[1].toLowerCase();(0===F.indexOf(p)||0===F.indexOf(q))&&(E=!0)}f>-1&&(c=c.replace(/format=[^,)]*[ ,]*/i,""),c=c.replace(/\(\s*\)/,"")),b=c.match(/\.ism\/manifest\([^)]*\)/i),b&&b.length>0&&(n=b[0].substr(t.length+1).trim()),c=g(a.src.trim());var G=u;a.streamingFormats&&d(a.streamingFormats)&&(G=a.streamingFormats);for(var H=0;H0?h:null}var i="SMOOTH",j="DASH",k="HLS-V3",l="HLS-V4",m="HLS",n=[i,j,l,k,m],o={DASH:"mpd-time-csf","HLS-V3":"m3u8-aapl-v3","HLS-V4":"m3u8-aapl-v4",HLS:"m3u8-aapl"},p="mpd-time-cmaf",q="m3u8-cmaf",r={SMOOTH:"application/vnd.ms-sstr+xml",DASH:"application/dash+xml","HLS-V3":"application/vnd.apple.mpegurl","HLS-V4":"application/vnd.apple.mpegurl",HLS:"application/vnd.apple.mpegurl"},s={SMOOTH:["PlayReady","AES"],DASH:["PlayReady","AES","Widevine"],"HLS-V3":["PlayReady","AES"],"HLS-V4":["PlayReady","AES"],HLS:["PlayReady","AES","FairPlay"]},t=".ism/manifest",u=n,v=function(){function a(a,b,c){this.src=a,this.type=b,this.protectionInfo=c}return a}();a.streamSrc=v;var w=function(){function a(){}return a}();a.protectionInfo=w,a.setStreamingFormats=b,a.resetStreamingFormats=c,a.expandSources=f}(UrlRewriter||(UrlRewriter={}));var AMP;!function(a){!function(a){"use strict";function b(a){for(var b="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",c=[],d=0;d>2)),e=(3&e)<<4,d>4)),e=(15&a[d++])<<2,d>6)),c.push(b.charAt(63&a[d++]))):(c.push(b.charAt(e)),c.push("="))):(c.push(b.charAt(e)),c.push("=="))}return c.join("")}function c(a){for(var b="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",c=new Uint8Array(new ArrayBuffer(3*a.length/4+4)),d=0,e=0;d>4,"="!==a.charAt(d+2)){var h=b.indexOf(a.charAt(d+2));if(c[e++]=g<<4|h>>2,"="!==a.charAt(d+3)){var i=b.indexOf(a.charAt(d+3));c[e++]=h<<6|i}}d+=4}return new Uint8Array(c.buffer,0,e)}a.binaryToBase64=b,a.base64ToBinary=c}(a.Base64Utils||(a.Base64Utils={}));a.Base64Utils}(AMP||(AMP={}));var AMP;!function(a){!function(a){"use strict";function b(a,b){o(a,3,b)}function c(a,b){o(a,2,b)}function d(a,b){o(a,1,b)}function e(a,b){o(a,0,b)}function f(a){for(var e=[],f=0;f0){var g=Array.prototype.slice.call(e[0]);switch(a){case"warn":c(4,g.join(" "));break;case"error":d(4,g.join(" "));break;case null:b(4,g.join(" "));break;default:b(4,g.join(" "))}}}function g(a){u=a}function h(a){void 0===a||null===a?v.forEach(function(a,b,c){c[b]=!0}):v[a]=!0}function i(a){void 0===a||null===a?v.forEach(function(a,b,c){c[b]=!1}):v[a]=!1}function j(a){"undefined"==typeof a&&(a=!0),y=a}function k(a){if(void 0!==a&&a.TraceTargets&&!(a.TraceTargets.length<=0)){y=!1,C=!1,u=a.maxLogLevel;for(var b=0;b=b&&v[a]){var e="["+("0"+d.getHours()).slice(-2)+":"+("0"+d.getMinutes()).slice(-2)+":"+("0"+(d.getSeconds()+d.getMilliseconds()/1e3).toFixed(3)).slice(-6)+"] "+p[b]+": "+q[a]+": "+c;y&&(z.length>A&&z.shift(),z.push(e)),C&&s.log(e)}}!function(a){a[a.none=0]="none",a[a.error=1]="error",a[a.warning=2]="warning",a[a.verbose=3]="verbose"}(a.Level||(a.Level={}));var p=a.Level;!function(a){a[a.functionalTest=0]="functionalTest",a[a.azureHtml5JS=1]="azureHtml5JS",a[a.flashSS=2]="flashSS",a[a.silverlightSS=3]="silverlightSS",a[a.videojs=4]="videojs",a[a.plugin=5]="plugin",a[a.html5FairplayHLS=6]="html5FairplayHLS",a[a.html5=7]="html5",a[a.scte35=8]="scte35",a[a.scheduler=9]="scheduler",a[a.ad=10]="ad",a[a.ampAPI=11]="ampAPI",a[a.cea608Module=12]="cea608Module",a[a.ttml=13]="ttml",a[a.max=14]="max"}(a.Area||(a.Area={}));var q=a.Area;a.verbose=b,a.warning=c,a.error=d,a.startup=e,a.videoJSLogOverride=f,a.setConsoleOutputByLevel=g,a.enableConsoleOutputByArea=h,a.disableConsoleOutputByArea=i,a.enableMemoryLog=j,a.setLogConfig=k,a.getMemoryLog=l,a.saveMemoryLog=m,a.getSavedMemoryLog=n,a.writeEntry=o;for(var r=function(){},s=window.console||{log:r,warn:r,error:r},t=!1,u=0,v=[],w=0;14>w;w++)v.push(!1);var x=5e4,y=!1,z=[],A=x,B=[],C=!0;a.enableConsoleOutputByArea(),a.setConsoleOutputByLevel(t?3:1)}(a.Logger||(a.Logger={}));a.Logger}(AMP||(AMP={}));var AMP;!function(a){!function(a){"use strict";function b(){for(var a=[],b=0;b0?a.getCurrentAlternativeAudioStreamIndex():void 0}return Object.defineProperty(b.prototype,"streams",{get:function(){return this._streams},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"enabledIndices",{get:function(){for(var a=[],b=0;b=this.streams.length||0>b)return a.Logger.error(2,"audioChange failed - tried to enable invalid index: "+b),void this._flashElement.tech.trigger(amp.streamListEventName.streamindexinvalid);if(b===this.enabledIndices[0])return a.Logger.verbose(2,"audioChange failed because current stream selected"),void this._flashElement.tech.trigger(amp.streamListEventName.streamselected);this.selectedIndex=b,this._flashElement.switchAlternativeAudioIndex(b),this._flashElement.tech.trigger(amp.streamListEventName.streamselected)}else a.Logger.error(2,"No alternative audio streams found")},b.prototype.addEventListener=function(a,b){this._flashElement.tech.on(a,b)},b.prototype.removeEventListener=function(a,b){this._flashElement.tech.off(a,b)},b}();b.AudioStreamList=c;var d=function(){function a(a,b){this.enabled=!1,this.language=a.getAlternativeAudioItemAt(b).info.attributes.Language,this.codec=a.getAlternativeAudioItemAt(b).info.targetTrack.fourCC,this.bitrate=1e3*a.getAlternativeAudioItemAt(b).bitrate,this.name=this.getName(a,b)}return a.prototype.getName=function(a,b){var c=a.getAlternativeAudioItemAt(b).info.urlTemplate.toLowerCase(),d="fragments(",e=c.indexOf(d),f=c.indexOf("=",e);return a.getAlternativeAudioItemAt(b).info.urlTemplate.substring(e+d.length,f)},a}();b.AudioStream=d}(a.FlashSS||(a.FlashSS={}));a.FlashSS}(AMP||(AMP={}));var AMP;!function(a){!function(a){"use strict";var b=function(){function a(a){if(this.streams=[],a.getIsDynamicStream()){var b=new c(a);this.streams.push(b)}this.selectedIndex=this.streams.length>0?0:void 0}return a}();a.VideoStreamList=b;var c=function(){function a(a){this.name="",this.tracks=[],this._flashElement=a,this._selectedTrack=-1;for(var b=a.getStreamItems(),c=0;c=0&&a"),d=b.indexOf("");if(-1===c||-1===d)throw Error("License data format not as expected, missing or misplaced tag");c+=5,b=b.substr(c,d-c);var e=a.Base64Utils.base64ToBinary(b);j.session.update(e)}catch(f){var g=f.message?f.message:"Failed to update MediaKeySession with fetched Fairplay license.";a.Logger.error(6,g),j.onError(5242886,g)}}function d(){if(!j.disposed){var b="Error occurred during Fairplay license fetch.";a.Logger.error(6,b),j.onError(5242886,b)}}if(!j.disposed){var e=new XMLHttpRequest;e.open("POST",j.licenseUrl,!0),e.onload=c,e.onerror=d,e.responseType="text";var f="spc="+a.Base64Utils.binaryToBase64(b.message)+"&assetId="+encodeURIComponent(j.contentId);e.setRequestHeader("Content-type","application/x-www-form-urlencoded"),j.srcInfo.fairplayInfo.authenticationToken&&e.setRequestHeader("Authorization",j.srcInfo.fairplayInfo.authenticationToken),a.Logger.verbose(6,"FairPlay License fetch initiated"),e.send(f)}}function d(){if(!j.disposed){var b="MediaKeyError code: "+j.session.error.code+", systemCode: "+AzureHtml5JS.Common.toHexString(j.session.error.systemCode);a.Logger.error(6,b),j.onError(5242880,b)}}function e(b,c){var d="video/mp4",e="WebKitMediaKeys"in window,f=null;try{if(!e||!window.WebKitMediaKeys.isTypeSupported(c,d))throw new Error("No EME support.");j.videoTag.webkitSetMediaKeys(new window.WebKitMediaKeys(c)),f=j.videoTag.webkitKeys.createSession(d,b)}catch(g){var h=g.message?g.message:c+" session creation failed";a.Logger.error(6,h),j.onError(5242881,h)}return f}function f(a){var b=h(a);return j.licenseUrl=b.substring(1).replace("skd://","https://"),g(j.licenseUrl)}function g(a){var b=document.createElement("a");return b.href=a,b.hostname}function h(a){var b=new Uint16Array(a.buffer);try{return String.fromCharCode.apply(null,b)}catch(c){for(var d=[],e=0;ed;d++)c[d]=a.charCodeAt(d);return c}if(!this.disposed){this.addEventListener(this.videoTag,"webkitneedkey",b,!1),this.videoTag.autoplay=this.srcInfo.autoPlay,this.videoTag.src=this.srcInfo.src,this.pendingPlay&&this.videoTag.play();var j=this; }},b.prototype.concatInitDataContentIdAndCertificate=function(a,b){var c=4,d=a.length+c+b.byteLength+c+this.certificate.byteLength,e=new ArrayBuffer(d),f=new DataView(e),g=0,h=new Uint8Array(e,g,a.byteLength);h.set(a),g+=h.byteLength,f.setUint32(g,b.byteLength,!0),g+=c;var i=new Uint16Array(e,g,b.length);i.set(b),g+=i.byteLength,f.setUint32(g,this.certificate.byteLength,!0),g+=c;var j=new Uint8Array(e,g,this.certificate.byteLength);return j.set(this.certificate),new Uint8Array(e,0,e.byteLength)},b}();b.FairPlay=g}(a.Html5Fairplay||(a.Html5Fairplay={}));a.Html5Fairplay}(AMP||(AMP={}));var AMP;!function(a){!function(b){"use strict";function c(a){var b=null;if(a)try{for(var c=window.atob(a),e=new ArrayBuffer(c.length),f=new Uint8Array(e),g=0;g18)try{var d=9e4,e=4294967296,f=67108864,g=16777216;c={id:void 0,startOffset:0};var h=b[4]>>7;if(h)a.Logger.warning(8,"Received encrypted message. Skipping..");else{var i=(127&b[4])*f+(b[5]<<18)+(b[6]<<10)+(b[7]<<2)+(b[8]>>6),j=b[13];if(5!=j)a.Logger.warning(8,"Skipping unsupported splice command: "+j);else if(c.id=b[14]*g+(b[15]<<16)+(b[16]<<8)+b[17],c.cancel=b[18]>>7==1,!c.cancel){c.out=b[19]>>7==1;var k=(64&b[19])>>6==1,l=(32&b[19])>>5==1,m=(16&b[19])>>4==1;if(k)if(m)-1==c.startOffset;else{var n=(128&b[20])>>7==1;if(n){var o=(1&b[20])*e+b[21]*g+(b[22]<<16)+(b[23]<<8)+b[24];c.startOffset=(o+i)/d}if(l){var p=n?25:21,q=(1&b[p],(1&b[p])*e+b[p+1]*g+(b[p+2]<<16)+(b[p+3]<<8)+b[p+4]);c.duration=q/d}}else a.Logger.warning(8,"Component splice mode is not supported.")}}}catch(r){c=null}return c}b.parseBase64EncodedMessage=c,b.parseBinaryMessage=d}(a.Scte35Parser||(a.Scte35Parser={}));a.Scte35Parser}(AMP||(AMP={})),function a(b,c,d){function e(g,h){if(!c[g]){if(!b[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:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;gb?-1:i+10>b?b-i+26+26:k+26>b?b-k:j+26>b?b-j+26:void 0}function c(a){function c(a){j[l++]=a}var d,e,g,h,i,j;if(a.length%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var k=a.length;i="="===a.charAt(k-2)?2:"="===a.charAt(k-1)?1:0,j=new f(3*a.length/4-i),g=i>0?a.length-4:a.length;var l=0;for(d=0,e=0;g>d;d+=4,e+=3)h=b(a.charAt(d))<<18|b(a.charAt(d+1))<<12|b(a.charAt(d+2))<<6|b(a.charAt(d+3)),c((16711680&h)>>16),c((65280&h)>>8),c(255&h);return 2===i?(h=b(a.charAt(d))<<2|b(a.charAt(d+1))>>4,c(255&h)):1===i&&(h=b(a.charAt(d))<<10|b(a.charAt(d+1))<<4|b(a.charAt(d+2))>>2,c(h>>8&255),c(255&h)),j}function e(a){function b(a){return d.charAt(a)}function c(a){return b(a>>18&63)+b(a>>12&63)+b(a>>6&63)+b(63&a)}var e,f,g,h=a.length%3,i="";for(e=0,g=a.length-h;g>e;e+=3)f=(a[e]<<16)+(a[e+1]<<8)+a[e+2],i+=c(f);switch(h){case 1:f=a[a.length-1],i+=b(f>>2),i+=b(f<<4&63),i+="==";break;case 2:f=(a[a.length-2]<<8)+a[a.length-1],i+=b(f>>10),i+=b(f>>4&63),i+=b(f<<2&63),i+="="}return i}var f="undefined"!=typeof Uint8Array?Uint8Array:Array,g="+".charCodeAt(0),h="/".charCodeAt(0),i="0".charCodeAt(0),j="a".charCodeAt(0),k="A".charCodeAt(0),l="-".charCodeAt(0),m="_".charCodeAt(0);a.toByteArray=c,a.fromByteArray=e}("undefined"==typeof c?this.base64js={}:c)},{}],2:[function(){},{}],3:[function(a,b,c){(function(b){/*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh * @license MIT */ "use strict";function d(){function a(){}try{var b=new Uint8Array(1);return b.foo=function(){return 42},b.constructor=a,42===b.foo()&&b.constructor===a&&"function"==typeof b.subarray&&0===b.subarray(1,1).byteLength}catch(c){return!1}}function e(){return f.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function f(a){return this instanceof f?(f.TYPED_ARRAY_SUPPORT||(this.length=0,this.parent=void 0),"number"==typeof a?g(this,a):"string"==typeof a?h(this,a,arguments.length>1?arguments[1]:"utf8"):i(this,a)):arguments.length>1?new f(a,arguments[1]):new f(a)}function g(a,b){if(a=p(a,0>b?0:0|q(b)),!f.TYPED_ARRAY_SUPPORT)for(var c=0;b>c;c++)a[c]=0;return a}function h(a,b,c){("string"!=typeof c||""===c)&&(c="utf8");var d=0|s(b,c);return a=p(a,d),a.write(b,c),a}function i(a,b){if(f.isBuffer(b))return j(a,b);if(Y(b))return k(a,b);if(null==b)throw new TypeError("must start with number, buffer, array or string");if("undefined"!=typeof ArrayBuffer){if(b.buffer instanceof ArrayBuffer)return l(a,b);if(b instanceof ArrayBuffer)return m(a,b)}return b.length?n(a,b):o(a,b)}function j(a,b){var c=0|q(b.length);return a=p(a,c),b.copy(a,0,0,c),a}function k(a,b){var c=0|q(b.length);a=p(a,c);for(var d=0;c>d;d+=1)a[d]=255&b[d];return a}function l(a,b){var c=0|q(b.length);a=p(a,c);for(var d=0;c>d;d+=1)a[d]=255&b[d];return a}function m(a,b){return f.TYPED_ARRAY_SUPPORT?(b.byteLength,a=f._augment(new Uint8Array(b))):a=l(a,new Uint8Array(b)),a}function n(a,b){var c=0|q(b.length);a=p(a,c);for(var d=0;c>d;d+=1)a[d]=255&b[d];return a}function o(a,b){var c,d=0;"Buffer"===b.type&&Y(b.data)&&(c=b.data,d=0|q(c.length)),a=p(a,d);for(var e=0;d>e;e+=1)a[e]=255&c[e];return a}function p(a,b){f.TYPED_ARRAY_SUPPORT?(a=f._augment(new Uint8Array(b)),a.__proto__=f.prototype):(a.length=b,a._isBuffer=!0);var c=0!==b&&b<=f.poolSize>>>1;return c&&(a.parent=Z),a}function q(a){if(a>=e())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+e().toString(16)+" bytes");return 0|a}function r(a,b){if(!(this instanceof r))return new r(a,b);var c=new f(a,b);return delete c.parent,c}function s(a,b){"string"!=typeof a&&(a=""+a);var c=a.length;if(0===c)return 0;for(var d=!1;;)switch(b){case"ascii":case"binary":case"raw":case"raws":return c;case"utf8":case"utf-8":return R(a).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*c;case"hex":return c>>>1;case"base64":return U(a).length;default:if(d)return R(a).length;b=(""+b).toLowerCase(),d=!0}}function t(a,b,c){var d=!1;if(b=0|b,c=void 0===c||c===1/0?this.length:0|c,a||(a="utf8"),0>b&&(b=0),c>this.length&&(c=this.length),b>=c)return"";for(;;)switch(a){case"hex":return F(this,b,c);case"utf8":case"utf-8":return B(this,b,c);case"ascii":return D(this,b,c);case"binary":return E(this,b,c);case"base64":return A(this,b,c);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return G(this,b,c);default:if(d)throw new TypeError("Unknown encoding: "+a);a=(a+"").toLowerCase(),d=!0}}function u(a,b,c,d){c=Number(c)||0;var e=a.length-c;d?(d=Number(d),d>e&&(d=e)):d=e;var f=b.length;if(f%2!==0)throw new Error("Invalid hex string");d>f/2&&(d=f/2);for(var g=0;d>g;g++){var h=parseInt(b.substr(2*g,2),16);if(isNaN(h))throw new Error("Invalid hex string");a[c+g]=h}return g}function v(a,b,c,d){return V(R(b,a.length-c),a,c,d)}function w(a,b,c,d){return V(S(b),a,c,d)}function x(a,b,c,d){return w(a,b,c,d)}function y(a,b,c,d){return V(U(b),a,c,d)}function z(a,b,c,d){return V(T(b,a.length-c),a,c,d)}function A(a,b,c){return W.fromByteArray(0===b&&c===a.length?a:a.slice(b,c))}function B(a,b,c){c=Math.min(a.length,c);for(var d=[],e=b;c>e;){var f=a[e],g=null,h=f>239?4:f>223?3:f>191?2:1;if(c>=e+h){var i,j,k,l;switch(h){case 1:128>f&&(g=f);break;case 2:i=a[e+1],128===(192&i)&&(l=(31&f)<<6|63&i,l>127&&(g=l));break;case 3:i=a[e+1],j=a[e+2],128===(192&i)&&128===(192&j)&&(l=(15&f)<<12|(63&i)<<6|63&j,l>2047&&(55296>l||l>57343)&&(g=l));break;case 4:i=a[e+1],j=a[e+2],k=a[e+3],128===(192&i)&&128===(192&j)&&128===(192&k)&&(l=(15&f)<<18|(63&i)<<12|(63&j)<<6|63&k,l>65535&&1114112>l&&(g=l))}}null===g?(g=65533,h=1):g>65535&&(g-=65536,d.push(g>>>10&1023|55296),g=56320|1023&g),d.push(g),e+=h}return C(d)}function C(a){var b=a.length;if($>=b)return String.fromCharCode.apply(String,a);for(var c="",d=0;b>d;)c+=String.fromCharCode.apply(String,a.slice(d,d+=$));return c}function D(a,b,c){var d="";c=Math.min(a.length,c);for(var e=b;c>e;e++)d+=String.fromCharCode(127&a[e]);return d}function E(a,b,c){var d="";c=Math.min(a.length,c);for(var e=b;c>e;e++)d+=String.fromCharCode(a[e]);return d}function F(a,b,c){var d=a.length;(!b||0>b)&&(b=0),(!c||0>c||c>d)&&(c=d);for(var e="",f=b;c>f;f++)e+=Q(a[f]);return e}function G(a,b,c){for(var d=a.slice(b,c),e="",f=0;fa)throw new RangeError("offset is not uint");if(a+b>c)throw new RangeError("Trying to access beyond buffer length")}function I(a,b,c,d,e,g){if(!f.isBuffer(a))throw new TypeError("buffer must be a Buffer instance");if(b>e||g>b)throw new RangeError("value is out of bounds");if(c+d>a.length)throw new RangeError("index out of range")}function J(a,b,c,d){0>b&&(b=65535+b+1);for(var e=0,f=Math.min(a.length-c,2);f>e;e++)a[c+e]=(b&255<<8*(d?e:1-e))>>>8*(d?e:1-e)}function K(a,b,c,d){0>b&&(b=4294967295+b+1);for(var e=0,f=Math.min(a.length-c,4);f>e;e++)a[c+e]=b>>>8*(d?e:3-e)&255}function L(a,b,c,d,e,f){if(b>e||f>b)throw new RangeError("value is out of bounds");if(c+d>a.length)throw new RangeError("index out of range");if(0>c)throw new RangeError("index out of range")}function M(a,b,c,d,e){return e||L(a,b,c,4,3.4028234663852886e38,-3.4028234663852886e38),X.write(a,b,c,d,23,4),c+4}function N(a,b,c,d,e){return e||L(a,b,c,8,1.7976931348623157e308,-1.7976931348623157e308),X.write(a,b,c,d,52,8),c+8}function O(a){if(a=P(a).replace(aa,""),a.length<2)return"";for(;a.length%4!==0;)a+="=";return a}function P(a){return a.trim?a.trim():a.replace(/^\s+|\s+$/g,"")}function Q(a){return 16>a?"0"+a.toString(16):a.toString(16)}function R(a,b){b=b||1/0;for(var c,d=a.length,e=null,f=[],g=0;d>g;g++){if(c=a.charCodeAt(g),c>55295&&57344>c){if(!e){if(c>56319){(b-=3)>-1&&f.push(239,191,189);continue}if(g+1===d){(b-=3)>-1&&f.push(239,191,189);continue}e=c;continue}if(56320>c){(b-=3)>-1&&f.push(239,191,189),e=c;continue}c=(e-55296<<10|c-56320)+65536}else e&&(b-=3)>-1&&f.push(239,191,189);if(e=null,128>c){if((b-=1)<0)break;f.push(c)}else if(2048>c){if((b-=2)<0)break;f.push(c>>6|192,63&c|128)}else if(65536>c){if((b-=3)<0)break;f.push(c>>12|224,c>>6&63|128,63&c|128)}else{if(!(1114112>c))throw new Error("Invalid code point");if((b-=4)<0)break;f.push(c>>18|240,c>>12&63|128,c>>6&63|128,63&c|128)}}return f}function S(a){for(var b=[],c=0;c>8,e=c%256,f.push(e),f.push(d);return f}function U(a){return W.toByteArray(O(a))}function V(a,b,c,d){for(var e=0;d>e&&!(e+c>=b.length||e>=a.length);e++)b[e+c]=a[e];return e}var W=a("base64-js"),X=a("ieee754"),Y=a("isarray");c.Buffer=f,c.SlowBuffer=r,c.INSPECT_MAX_BYTES=50,f.poolSize=8192;var Z={};f.TYPED_ARRAY_SUPPORT=void 0!==b.TYPED_ARRAY_SUPPORT?b.TYPED_ARRAY_SUPPORT:d(),f.TYPED_ARRAY_SUPPORT?(f.prototype.__proto__=Uint8Array.prototype,f.__proto__=Uint8Array):(f.prototype.length=void 0,f.prototype.parent=void 0),f.isBuffer=function(a){return!(null==a||!a._isBuffer)},f.compare=function(a,b){if(!f.isBuffer(a)||!f.isBuffer(b))throw new TypeError("Arguments must be Buffers");if(a===b)return 0;for(var c=a.length,d=b.length,e=0,g=Math.min(c,d);g>e&&a[e]===b[e];)++e;return e!==g&&(c=a[e],d=b[e]),d>c?-1:c>d?1:0},f.isEncoding=function(a){switch(String(a).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"raw":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},f.concat=function(a,b){if(!Y(a))throw new TypeError("list argument must be an Array of Buffers.");if(0===a.length)return new f(0);var c;if(void 0===b)for(b=0,c=0;c0&&(a=this.toString("hex",0,b).match(/.{2}/g).join(" "),this.length>b&&(a+=" ... ")),""},f.prototype.compare=function(a){if(!f.isBuffer(a))throw new TypeError("Argument must be a Buffer");return this===a?0:f.compare(this,a)},f.prototype.indexOf=function(a,b){function c(a,b,c){for(var d=-1,e=0;c+e2147483647?b=2147483647:-2147483648>b&&(b=-2147483648),b>>=0,0===this.length)return-1;if(b>=this.length)return-1;if(0>b&&(b=Math.max(this.length+b,0)),"string"==typeof a)return 0===a.length?-1:String.prototype.indexOf.call(this,a,b);if(f.isBuffer(a))return c(this,a,b);if("number"==typeof a)return f.TYPED_ARRAY_SUPPORT&&"function"===Uint8Array.prototype.indexOf?Uint8Array.prototype.indexOf.call(this,a,b):c(this,[a],b);throw new TypeError("val must be string, number or Buffer")},f.prototype.get=function(a){return this.readUInt8(a)},f.prototype.set=function(a,b){return this.writeUInt8(a,b)},f.prototype.write=function(a,b,c,d){if(void 0===b)d="utf8",c=this.length,b=0;else if(void 0===c&&"string"==typeof b)d=b,c=this.length,b=0;else if(isFinite(b))b=0|b,isFinite(c)?(c=0|c,void 0===d&&(d="utf8")):(d=c,c=void 0);else{var e=d;d=b,b=0|c,c=e}var f=this.length-b;if((void 0===c||c>f)&&(c=f),a.length>0&&(0>c||0>b)||b>this.length)throw new RangeError("attempt to write outside buffer bounds");d||(d="utf8");for(var g=!1;;)switch(d){case"hex":return u(this,a,b,c);case"utf8":case"utf-8":return v(this,a,b,c);case"ascii":return w(this,a,b,c);case"binary":return x(this,a,b,c);case"base64":return y(this,a,b,c);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return z(this,a,b,c);default:if(g)throw new TypeError("Unknown encoding: "+d);d=(""+d).toLowerCase(),g=!0}},f.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var $=4096;f.prototype.slice=function(a,b){var c=this.length;a=~~a,b=void 0===b?c:~~b,0>a?(a+=c,0>a&&(a=0)):a>c&&(a=c),0>b?(b+=c,0>b&&(b=0)):b>c&&(b=c),a>b&&(b=a);var d;if(f.TYPED_ARRAY_SUPPORT)d=f._augment(this.subarray(a,b));else{var e=b-a;d=new f(e,void 0);for(var g=0;e>g;g++)d[g]=this[g+a]}return d.length&&(d.parent=this.parent||this),d},f.prototype.readUIntLE=function(a,b,c){a=0|a,b=0|b,c||H(a,b,this.length);for(var d=this[a],e=1,f=0;++f0&&(e*=256);)d+=this[a+--b]*e;return d},f.prototype.readUInt8=function(a,b){return b||H(a,1,this.length),this[a]},f.prototype.readUInt16LE=function(a,b){return b||H(a,2,this.length),this[a]|this[a+1]<<8},f.prototype.readUInt16BE=function(a,b){return b||H(a,2,this.length),this[a]<<8|this[a+1]},f.prototype.readUInt32LE=function(a,b){return b||H(a,4,this.length),(this[a]|this[a+1]<<8|this[a+2]<<16)+16777216*this[a+3]},f.prototype.readUInt32BE=function(a,b){return b||H(a,4,this.length),16777216*this[a]+(this[a+1]<<16|this[a+2]<<8|this[a+3])},f.prototype.readIntLE=function(a,b,c){a=0|a,b=0|b,c||H(a,b,this.length);for(var d=this[a],e=1,f=0;++f=e&&(d-=Math.pow(2,8*b)),d},f.prototype.readIntBE=function(a,b,c){a=0|a,b=0|b,c||H(a,b,this.length);for(var d=b,e=1,f=this[a+--d];d>0&&(e*=256);)f+=this[a+--d]*e;return e*=128,f>=e&&(f-=Math.pow(2,8*b)),f},f.prototype.readInt8=function(a,b){return b||H(a,1,this.length),128&this[a]?-1*(255-this[a]+1):this[a]},f.prototype.readInt16LE=function(a,b){b||H(a,2,this.length);var c=this[a]|this[a+1]<<8;return 32768&c?4294901760|c:c},f.prototype.readInt16BE=function(a,b){b||H(a,2,this.length);var c=this[a+1]|this[a]<<8;return 32768&c?4294901760|c:c},f.prototype.readInt32LE=function(a,b){return b||H(a,4,this.length),this[a]|this[a+1]<<8|this[a+2]<<16|this[a+3]<<24},f.prototype.readInt32BE=function(a,b){return b||H(a,4,this.length),this[a]<<24|this[a+1]<<16|this[a+2]<<8|this[a+3]},f.prototype.readFloatLE=function(a,b){return b||H(a,4,this.length),X.read(this,a,!0,23,4)},f.prototype.readFloatBE=function(a,b){return b||H(a,4,this.length),X.read(this,a,!1,23,4)},f.prototype.readDoubleLE=function(a,b){return b||H(a,8,this.length),X.read(this,a,!0,52,8)},f.prototype.readDoubleBE=function(a,b){return b||H(a,8,this.length),X.read(this,a,!1,52,8)},f.prototype.writeUIntLE=function(a,b,c,d){a=+a,b=0|b,c=0|c,d||I(this,a,b,c,Math.pow(2,8*c),0);var e=1,f=0;for(this[b]=255&a;++f=0&&(f*=256);)this[b+e]=a/f&255;return b+c},f.prototype.writeUInt8=function(a,b,c){return a=+a,b=0|b,c||I(this,a,b,1,255,0),f.TYPED_ARRAY_SUPPORT||(a=Math.floor(a)),this[b]=255&a,b+1},f.prototype.writeUInt16LE=function(a,b,c){return a=+a,b=0|b,c||I(this,a,b,2,65535,0),f.TYPED_ARRAY_SUPPORT?(this[b]=255&a,this[b+1]=a>>>8):J(this,a,b,!0),b+2},f.prototype.writeUInt16BE=function(a,b,c){return a=+a,b=0|b,c||I(this,a,b,2,65535,0),f.TYPED_ARRAY_SUPPORT?(this[b]=a>>>8,this[b+1]=255&a):J(this,a,b,!1),b+2},f.prototype.writeUInt32LE=function(a,b,c){return a=+a,b=0|b,c||I(this,a,b,4,4294967295,0),f.TYPED_ARRAY_SUPPORT?(this[b+3]=a>>>24,this[b+2]=a>>>16,this[b+1]=a>>>8,this[b]=255&a):K(this,a,b,!0),b+4},f.prototype.writeUInt32BE=function(a,b,c){return a=+a,b=0|b,c||I(this,a,b,4,4294967295,0),f.TYPED_ARRAY_SUPPORT?(this[b]=a>>>24,this[b+1]=a>>>16,this[b+2]=a>>>8,this[b+3]=255&a):K(this,a,b,!1),b+4},f.prototype.writeIntLE=function(a,b,c,d){if(a=+a,b=0|b,!d){var e=Math.pow(2,8*c-1);I(this,a,b,c,e-1,-e)}var f=0,g=1,h=0>a?1:0;for(this[b]=255&a;++f>0)-h&255;return b+c},f.prototype.writeIntBE=function(a,b,c,d){if(a=+a,b=0|b,!d){var e=Math.pow(2,8*c-1);I(this,a,b,c,e-1,-e)}var f=c-1,g=1,h=0>a?1:0;for(this[b+f]=255&a;--f>=0&&(g*=256);)this[b+f]=(a/g>>0)-h&255;return b+c},f.prototype.writeInt8=function(a,b,c){return a=+a,b=0|b,c||I(this,a,b,1,127,-128),f.TYPED_ARRAY_SUPPORT||(a=Math.floor(a)),0>a&&(a=255+a+1),this[b]=255&a,b+1},f.prototype.writeInt16LE=function(a,b,c){return a=+a,b=0|b,c||I(this,a,b,2,32767,-32768),f.TYPED_ARRAY_SUPPORT?(this[b]=255&a,this[b+1]=a>>>8):J(this,a,b,!0),b+2},f.prototype.writeInt16BE=function(a,b,c){return a=+a,b=0|b,c||I(this,a,b,2,32767,-32768),f.TYPED_ARRAY_SUPPORT?(this[b]=a>>>8,this[b+1]=255&a):J(this,a,b,!1),b+2},f.prototype.writeInt32LE=function(a,b,c){return a=+a,b=0|b,c||I(this,a,b,4,2147483647,-2147483648),f.TYPED_ARRAY_SUPPORT?(this[b]=255&a,this[b+1]=a>>>8,this[b+2]=a>>>16,this[b+3]=a>>>24):K(this,a,b,!0),b+4},f.prototype.writeInt32BE=function(a,b,c){return a=+a,b=0|b,c||I(this,a,b,4,2147483647,-2147483648),0>a&&(a=4294967295+a+1),f.TYPED_ARRAY_SUPPORT?(this[b]=a>>>24,this[b+1]=a>>>16,this[b+2]=a>>>8,this[b+3]=255&a):K(this,a,b,!1),b+4},f.prototype.writeFloatLE=function(a,b,c){return M(this,a,b,!0,c)},f.prototype.writeFloatBE=function(a,b,c){return M(this,a,b,!1,c)},f.prototype.writeDoubleLE=function(a,b,c){return N(this,a,b,!0,c)},f.prototype.writeDoubleBE=function(a,b,c){return N(this,a,b,!1,c)},f.prototype.copy=function(a,b,c,d){if(c||(c=0),d||0===d||(d=this.length),b>=a.length&&(b=a.length),b||(b=0),d>0&&c>d&&(d=c),d===c)return 0;if(0===a.length||0===this.length)return 0;if(0>b)throw new RangeError("targetStart out of bounds");if(0>c||c>=this.length)throw new RangeError("sourceStart out of bounds");if(0>d)throw new RangeError("sourceEnd out of bounds");d>this.length&&(d=this.length),a.length-bc&&d>b)for(e=g-1;e>=0;e--)a[e+b]=this[e+c];else if(1e3>g||!f.TYPED_ARRAY_SUPPORT)for(e=0;g>e;e++)a[e+b]=this[e+c];else a._set(this.subarray(c,c+g),b);return g},f.prototype.fill=function(a,b,c){if(a||(a=0),b||(b=0),c||(c=this.length),b>c)throw new RangeError("end < start");if(c!==b&&0!==this.length){if(0>b||b>=this.length)throw new RangeError("start out of bounds");if(0>c||c>this.length)throw new RangeError("end out of bounds");var d;if("number"==typeof a)for(d=b;c>d;d++)this[d]=a;else{var e=R(a.toString()),f=e.length;for(d=b;c>d;d++)this[d]=e[d%f]}return this}},f.prototype.toArrayBuffer=function(){if("undefined"!=typeof Uint8Array){if(f.TYPED_ARRAY_SUPPORT)return new f(this).buffer;for(var a=new Uint8Array(this.length),b=0,c=a.length;c>b;b+=1)a[b]=this[b];return a.buffer}throw new TypeError("Buffer.toArrayBuffer not supported in this browser")};var _=f.prototype;f._augment=function(a){return a.constructor=f,a._isBuffer=!0,a._set=a.set,a.get=_.get,a.set=_.set,a.write=_.write,a.toString=_.toString,a.toLocaleString=_.toString,a.toJSON=_.toJSON,a.equals=_.equals,a.compare=_.compare,a.indexOf=_.indexOf,a.copy=_.copy,a.slice=_.slice,a.readUIntLE=_.readUIntLE,a.readUIntBE=_.readUIntBE,a.readUInt8=_.readUInt8,a.readUInt16LE=_.readUInt16LE,a.readUInt16BE=_.readUInt16BE,a.readUInt32LE=_.readUInt32LE,a.readUInt32BE=_.readUInt32BE,a.readIntLE=_.readIntLE,a.readIntBE=_.readIntBE,a.readInt8=_.readInt8,a.readInt16LE=_.readInt16LE,a.readInt16BE=_.readInt16BE,a.readInt32LE=_.readInt32LE,a.readInt32BE=_.readInt32BE,a.readFloatLE=_.readFloatLE,a.readFloatBE=_.readFloatBE,a.readDoubleLE=_.readDoubleLE,a.readDoubleBE=_.readDoubleBE,a.writeUInt8=_.writeUInt8,a.writeUIntLE=_.writeUIntLE,a.writeUIntBE=_.writeUIntBE,a.writeUInt16LE=_.writeUInt16LE,a.writeUInt16BE=_.writeUInt16BE,a.writeUInt32LE=_.writeUInt32LE,a.writeUInt32BE=_.writeUInt32BE,a.writeIntLE=_.writeIntLE,a.writeIntBE=_.writeIntBE,a.writeInt8=_.writeInt8,a.writeInt16LE=_.writeInt16LE,a.writeInt16BE=_.writeInt16BE,a.writeInt32LE=_.writeInt32LE,a.writeInt32BE=_.writeInt32BE,a.writeFloatLE=_.writeFloatLE,a.writeFloatBE=_.writeFloatBE,a.writeDoubleLE=_.writeDoubleLE,a.writeDoubleBE=_.writeDoubleBE,a.fill=_.fill,a.inspect=_.inspect,a.toArrayBuffer=_.toArrayBuffer,a};var aa=/[^+\/0-9A-Za-z-_]/g}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"base64-js":1,ieee754:7,isarray:4}],4:[function(a,b){var c={}.toString;b.exports=Array.isArray||function(a){return"[object Array]"==c.call(a)}},{}],5:[function(a,b,c){(function(a){function b(a){return Array.isArray?Array.isArray(a):"[object Array]"===q(a)}function d(a){return"boolean"==typeof a}function e(a){return null===a}function f(a){return null==a}function g(a){return"number"==typeof a}function h(a){return"string"==typeof a}function i(a){return"symbol"==typeof a}function j(a){return void 0===a}function k(a){return"[object RegExp]"===q(a)}function l(a){return"object"==typeof a&&null!==a}function m(a){return"[object Date]"===q(a)}function n(a){return"[object Error]"===q(a)||a instanceof Error}function o(a){return"function"==typeof a}function p(a){return null===a||"boolean"==typeof a||"number"==typeof a||"string"==typeof a||"symbol"==typeof a||"undefined"==typeof a}function q(a){return Object.prototype.toString.call(a)}c.isArray=b,c.isBoolean=d,c.isNull=e,c.isNullOrUndefined=f,c.isNumber=g,c.isString=h,c.isSymbol=i,c.isUndefined=j,c.isRegExp=k,c.isObject=l,c.isDate=m,c.isError=n,c.isFunction=o,c.isPrimitive=p,c.isBuffer=a.isBuffer}).call(this,{isBuffer:a("../../is-buffer/index.js")})},{"../../is-buffer/index.js":9}],6:[function(a,b){function c(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function d(a){return"function"==typeof a}function e(a){return"number"==typeof a}function f(a){return"object"==typeof a&&null!==a}function g(a){return void 0===a}b.exports=c,c.EventEmitter=c,c.prototype._events=void 0,c.prototype._maxListeners=void 0,c.defaultMaxListeners=10,c.prototype.setMaxListeners=function(a){if(!e(a)||0>a||isNaN(a))throw TypeError("n must be a positive number");return this._maxListeners=a,this},c.prototype.emit=function(a){var b,c,e,h,i,j;if(this._events||(this._events={}),"error"===a&&(!this._events.error||f(this._events.error)&&!this._events.error.length)){if(b=arguments[1],b instanceof Error)throw b;throw TypeError('Uncaught, unspecified "error" event.')}if(c=this._events[a],g(c))return!1;if(d(c))switch(arguments.length){case 1:c.call(this);break;case 2:c.call(this,arguments[1]);break;case 3:c.call(this,arguments[1],arguments[2]);break;default:for(e=arguments.length,h=new Array(e-1),i=1;e>i;i++)h[i-1]=arguments[i];c.apply(this,h)}else if(f(c)){for(e=arguments.length,h=new Array(e-1),i=1;e>i;i++)h[i-1]=arguments[i];for(j=c.slice(),e=j.length,i=0;e>i;i++)j[i].apply(this,h)}return!0},c.prototype.addListener=function(a,b){var e;if(!d(b))throw TypeError("listener must be a function");if(this._events||(this._events={}),this._events.newListener&&this.emit("newListener",a,d(b.listener)?b.listener:b),this._events[a]?f(this._events[a])?this._events[a].push(b):this._events[a]=[this._events[a],b]:this._events[a]=b,f(this._events[a])&&!this._events[a].warned){var e;e=g(this._maxListeners)?c.defaultMaxListeners:this._maxListeners,e&&e>0&&this._events[a].length>e&&(this._events[a].warned=!0,"function"==typeof console.trace)}return this},c.prototype.on=c.prototype.addListener,c.prototype.once=function(a,b){function c(){this.removeListener(a,c),e||(e=!0,b.apply(this,arguments))}if(!d(b))throw TypeError("listener must be a function");var e=!1;return c.listener=b,this.on(a,c),this},c.prototype.removeListener=function(a,b){var c,e,g,h;if(!d(b))throw TypeError("listener must be a function");if(!this._events||!this._events[a])return this;if(c=this._events[a],g=c.length,e=-1,c===b||d(c.listener)&&c.listener===b)delete this._events[a],this._events.removeListener&&this.emit("removeListener",a,b);else if(f(c)){for(h=g;h-->0;)if(c[h]===b||c[h].listener&&c[h].listener===b){e=h;break}if(0>e)return this;1===c.length?(c.length=0,delete this._events[a]):c.splice(e,1),this._events.removeListener&&this.emit("removeListener",a,b)}return this},c.prototype.removeAllListeners=function(a){var b,c;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[a]&&delete this._events[a],this;if(0===arguments.length){for(b in this._events)"removeListener"!==b&&this.removeAllListeners(b);return this.removeAllListeners("removeListener"),this._events={},this}if(c=this._events[a],d(c))this.removeListener(a,c);else for(;c.length;)this.removeListener(a,c[c.length-1]);return delete this._events[a],this},c.prototype.listeners=function(a){var b;return b=this._events&&this._events[a]?d(this._events[a])?[this._events[a]]:this._events[a].slice():[]},c.listenerCount=function(a,b){var c;return c=a._events&&a._events[b]?d(a._events[b])?1:a._events[b].length:0}},{}],7:[function(a,b,c){c.read=function(a,b,c,d,e){var f,g,h=8*e-d-1,i=(1<>1,k=-7,l=c?e-1:0,m=c?-1:1,n=a[b+l];for(l+=m,f=n&(1<<-k)-1,n>>=-k,k+=h;k>0;f=256*f+a[b+l],l+=m,k-=8);for(g=f&(1<<-k)-1,f>>=-k,k+=d;k>0;g=256*g+a[b+l],l+=m,k-=8);if(0===f)f=1-j;else{if(f===i)return g?0/0:(n?-1:1)*(1/0);g+=Math.pow(2,d),f-=j}return(n?-1:1)*g*Math.pow(2,f-d)},c.write=function(a,b,c,d,e,f){var g,h,i,j=8*f-e-1,k=(1<>1,m=23===e?Math.pow(2,-24)-Math.pow(2,-77):0,n=d?0:f-1,o=d?1:-1,p=0>b||0===b&&0>1/b?1:0;for(b=Math.abs(b),isNaN(b)||b===1/0?(h=isNaN(b)?1:0,g=k):(g=Math.floor(Math.log(b)/Math.LN2),b*(i=Math.pow(2,-g))<1&&(g--,i*=2),b+=g+l>=1?m/i:m*Math.pow(2,1-l),b*i>=2&&(g++,i/=2),g+l>=k?(h=0,g=k):g+l>=1?(h=(b*i-1)*Math.pow(2,e),g+=l):(h=b*Math.pow(2,l-1)*Math.pow(2,e),g=0));e>=8;a[c+n]=255&h,n+=o,h/=256,e-=8);for(g=g<0;a[c+n]=255&g,n+=o,g/=256,j-=8);a[c+n-o]|=128*p}},{}],8:[function(a,b){b.exports="function"==typeof Object.create?function(a,b){a.super_=b,a.prototype=Object.create(b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}})}:function(a,b){a.super_=b;var c=function(){};c.prototype=b.prototype,a.prototype=new c,a.prototype.constructor=a}},{}],9:[function(a,b){function c(a){return!!a.constructor&&"function"==typeof a.constructor.isBuffer&&a.constructor.isBuffer(a)}function d(a){return"function"==typeof a.readFloatLE&&"function"==typeof a.slice&&c(a.slice(0,0))}/*! * Determine if an object is a Buffer * * @author Feross Aboukhadijeh * @license MIT */ b.exports=function(a){return null!=a&&(c(a)||d(a)||!!a._isBuffer)}},{}],10:[function(a,b){b.exports=Array.isArray||function(a){return"[object Array]"==Object.prototype.toString.call(a)}},{}],11:[function(a,b){function c(){if(!g){g=!0;for(var a,b=f.length;b;){a=f,f=[];for(var c=-1;++cc;c++)b(a[c],c)}b.exports=d;var g=Object.keys||function(a){var b=[];for(var c in a)b.push(c);return b},h=a("core-util-is");h.inherits=a("inherits");var i=a("./_stream_readable"),j=a("./_stream_writable");h.inherits(d,i),f(g(j.prototype),function(a){d.prototype[a]||(d.prototype[a]=j.prototype[a])})}).call(this,a("_process"))},{"./_stream_readable":15,"./_stream_writable":17,_process:11,"core-util-is":5,inherits:8}],14:[function(a,b){function c(a){return this instanceof c?void d.call(this,a):new c(a)}b.exports=c;var d=a("./_stream_transform"),e=a("core-util-is");e.inherits=a("inherits"),e.inherits(c,d),c.prototype._transform=function(a,b,c){c(null,a)}},{"./_stream_transform":16,"core-util-is":5,inherits:8}],15:[function(a,b){(function(c){function d(b,c){var d=a("./_stream_duplex");b=b||{};var e=b.highWaterMark,f=b.objectMode?16:16384;this.highWaterMark=e||0===e?e:f,this.highWaterMark=~~this.highWaterMark,this.buffer=[],this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.objectMode=!!b.objectMode,c instanceof d&&(this.objectMode=this.objectMode||!!b.readableObjectMode),this.defaultEncoding=b.defaultEncoding||"utf8",this.ranOut=!1,this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,b.encoding&&(C||(C=a("string_decoder/").StringDecoder),this.decoder=new C(b.encoding),this.encoding=b.encoding)}function e(b){a("./_stream_duplex");return this instanceof e?(this._readableState=new d(b,this),this.readable=!0,void A.call(this)):new e(b)}function f(a,b,c,d,e){var f=j(b,c);if(f)a.emit("error",f);else if(B.isNullOrUndefined(c))b.reading=!1,b.ended||k(a,b);else if(b.objectMode||c&&c.length>0)if(b.ended&&!e){var h=new Error("stream.push() after EOF");a.emit("error",h)}else if(b.endEmitted&&e){var h=new Error("stream.unshift() after end event");a.emit("error",h)}else!b.decoder||e||d||(c=b.decoder.write(c)),e||(b.reading=!1),b.flowing&&0===b.length&&!b.sync?(a.emit("data",c),a.read(0)):(b.length+=b.objectMode?1:c.length,e?b.buffer.unshift(c):b.buffer.push(c),b.needReadable&&l(a)),n(a,b);else e||(b.reading=!1);return g(b)}function g(a){return!a.ended&&(a.needReadable||a.length=E)a=E;else{a--;for(var b=1;32>b;b<<=1)a|=a>>b;a++}return a}function i(a,b){return 0===b.length&&b.ended?0:b.objectMode?0===a?0:1:isNaN(a)||B.isNull(a)?b.flowing&&b.buffer.length?b.buffer[0].length:b.length:0>=a?0:(a>b.highWaterMark&&(b.highWaterMark=h(a)),a>b.length?b.ended?b.length:(b.needReadable=!0,0):a)}function j(a,b){var c=null;return B.isBuffer(b)||B.isString(b)||B.isNullOrUndefined(b)||a.objectMode||(c=new TypeError("Invalid non-string/buffer chunk")),c}function k(a,b){if(b.decoder&&!b.ended){var c=b.decoder.end();c&&c.length&&(b.buffer.push(c),b.length+=b.objectMode?1:c.length)}b.ended=!0,l(a)}function l(a){var b=a._readableState;b.needReadable=!1,b.emittedReadable||(D("emitReadable",b.flowing),b.emittedReadable=!0,b.sync?c.nextTick(function(){m(a)}):m(a))}function m(a){D("emit readable"),a.emit("readable"),s(a)}function n(a,b){b.readingMore||(b.readingMore=!0,c.nextTick(function(){o(a,b)}))}function o(a,b){for(var c=b.length;!b.reading&&!b.flowing&&!b.ended&&b.length=e)c=f?d.join(""):y.concat(d,e),d.length=0;else if(aj&&a>i;j++){var h=d[0],l=Math.min(a-i,h.length);f?c+=h.slice(0,l):h.copy(c,i,0,l),l0)throw new Error("endReadable called on non-empty stream");b.endEmitted||(b.ended=!0,c.nextTick(function(){b.endEmitted||0!==b.length||(b.endEmitted=!0,a.readable=!1,a.emit("end"))}))}function v(a,b){for(var c=0,d=a.length;d>c;c++)b(a[c],c)}function w(a,b){for(var c=0,d=a.length;d>c;c++)if(a[c]===b)return c;return-1}b.exports=e;var x=a("isarray"),y=a("buffer").Buffer;e.ReadableState=d;var z=a("events").EventEmitter;z.listenerCount||(z.listenerCount=function(a,b){return a.listeners(b).length});var A=a("stream"),B=a("core-util-is");B.inherits=a("inherits");var C,D=a("util");D=D&&D.debuglog?D.debuglog("stream"):function(){},B.inherits(e,A),e.prototype.push=function(a,b){var c=this._readableState;return B.isString(a)&&!c.objectMode&&(b=b||c.defaultEncoding,b!==c.encoding&&(a=new y(a,b),b="")),f(this,c,a,b,!1)},e.prototype.unshift=function(a){var b=this._readableState;return f(this,b,a,"",!0)},e.prototype.setEncoding=function(b){return C||(C=a("string_decoder/").StringDecoder),this._readableState.decoder=new C(b),this._readableState.encoding=b,this};var E=8388608;e.prototype.read=function(a){D("read",a);var b=this._readableState,c=a;if((!B.isNumber(a)||a>0)&&(b.emittedReadable=!1),0===a&&b.needReadable&&(b.length>=b.highWaterMark||b.ended))return D("read: emitReadable",b.length,b.ended),0===b.length&&b.ended?u(this):l(this),null;if(a=i(a,b),0===a&&b.ended)return 0===b.length&&u(this),null;var d=b.needReadable;D("need readable",d),(0===b.length||b.length-a0?t(a,b):null,B.isNull(e)&&(b.needReadable=!0,a=0),b.length-=a,0!==b.length||b.ended||(b.needReadable=!0),c!==a&&b.ended&&0===b.length&&u(this),B.isNull(e)||this.emit("data",e),e},e.prototype._read=function(){this.emit("error",new Error("not implemented"))},e.prototype.pipe=function(a,b){function d(a){D("onunpipe"),a===l&&f()}function e(){D("onend"),a.end()}function f(){D("cleanup"),a.removeListener("close",i),a.removeListener("finish",j),a.removeListener("drain",q),a.removeListener("error",h),a.removeListener("unpipe",d),l.removeListener("end",e),l.removeListener("end",f),l.removeListener("data",g),!m.awaitDrain||a._writableState&&!a._writableState.needDrain||q()}function g(b){D("ondata");var c=a.write(b);!1===c&&(D("false write response, pause",l._readableState.awaitDrain),l._readableState.awaitDrain++,l.pause())}function h(b){D("onerror",b),k(),a.removeListener("error",h),0===z.listenerCount(a,"error")&&a.emit("error",b)}function i(){a.removeListener("finish",j),k()}function j(){D("onfinish"),a.removeListener("close",i),k()}function k(){D("unpipe"),l.unpipe(a)}var l=this,m=this._readableState;switch(m.pipesCount){case 0:m.pipes=a;break;case 1:m.pipes=[m.pipes,a];break;default:m.pipes.push(a)}m.pipesCount+=1,D("pipe count=%d opts=%j",m.pipesCount,b);var n=(!b||b.end!==!1)&&a!==c.stdout&&a!==c.stderr,o=n?e:f;m.endEmitted?c.nextTick(o):l.once("end",o),a.on("unpipe",d);var q=p(l);return a.on("drain",q),l.on("data",g),a._events&&a._events.error?x(a._events.error)?a._events.error.unshift(h):a._events.error=[h,a._events.error]:a.on("error",h),a.once("close",i),a.once("finish",j),a.emit("pipe",l),m.flowing||(D("pipe resume"),l.resume()),a},e.prototype.unpipe=function(a){var b=this._readableState;if(0===b.pipesCount)return this;if(1===b.pipesCount)return a&&a!==b.pipes?this:(a||(a=b.pipes),b.pipes=null,b.pipesCount=0,b.flowing=!1,a&&a.emit("unpipe",this),this);if(!a){var c=b.pipes,d=b.pipesCount;b.pipes=null,b.pipesCount=0,b.flowing=!1;for(var e=0;d>e;e++)c[e].emit("unpipe",this);return this}var e=w(b.pipes,a);return-1===e?this:(b.pipes.splice(e,1),b.pipesCount-=1,1===b.pipesCount&&(b.pipes=b.pipes[0]),a.emit("unpipe",this),this)},e.prototype.on=function(a,b){var d=A.prototype.on.call(this,a,b);if("data"===a&&!1!==this._readableState.flowing&&this.resume(),"readable"===a&&this.readable){var e=this._readableState;if(!e.readableListening)if(e.readableListening=!0,e.emittedReadable=!1,e.needReadable=!0,e.reading)e.length&&l(this,e);else{var f=this;c.nextTick(function(){D("readable nexttick read 0"),f.read(0)})}}return d},e.prototype.addListener=e.prototype.on,e.prototype.resume=function(){var a=this._readableState;return a.flowing||(D("resume"),a.flowing=!0,a.reading||(D("resume read 0"),this.read(0)),q(this,a)),this},e.prototype.pause=function(){return D("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(D("pause"),this._readableState.flowing=!1,this.emit("pause")),this},e.prototype.wrap=function(a){var b=this._readableState,c=!1,d=this;a.on("end",function(){if(D("wrapped end"),b.decoder&&!b.ended){var a=b.decoder.end();a&&a.length&&d.push(a)}d.push(null)}),a.on("data",function(e){if(D("wrapped data"),b.decoder&&(e=b.decoder.write(e)),e&&(b.objectMode||e.length)){var f=d.push(e);f||(c=!0,a.pause())}});for(var e in a)B.isFunction(a[e])&&B.isUndefined(this[e])&&(this[e]=function(b){return function(){return a[b].apply(a,arguments)}}(e));var f=["error","close","destroy","pause","resume"];return v(f,function(b){a.on(b,d.emit.bind(d,b))}),d._read=function(b){D("wrapped _read",b),c&&(c=!1,a.resume())},d},e._fromList=t}).call(this,a("_process"))},{"./_stream_duplex":13,_process:11,buffer:3,"core-util-is":5,events:6,inherits:8,isarray:10,stream:22,"string_decoder/":23,util:2}],16:[function(a,b){function c(a,b){this.afterTransform=function(a,c){return d(b,a,c)},this.needTransform=!1,this.transforming=!1,this.writecb=null,this.writechunk=null}function d(a,b,c){var d=a._transformState;d.transforming=!1;var e=d.writecb;if(!e)return a.emit("error",new Error("no writecb in Transform class"));d.writechunk=null,d.writecb=null,h.isNullOrUndefined(c)||a.push(c),e&&e(b);var f=a._readableState;f.reading=!1,(f.needReadable||f.length1){for(var c=[],d=0;d=this.charLength-this.charReceived?this.charLength-this.charReceived:a.length;if(a.copy(this.charBuffer,this.charReceived,0,c),this.charReceived+=c,this.charReceived=55296&&56319>=d)){if(this.charReceived=this.charLength=0,0===a.length)return b;break}this.charLength+=this.surrogateSize,b=""}this.detectIncompleteChar(a);var e=a.length;this.charLength&&(a.copy(this.charBuffer,0,a.length-this.charReceived,e),e-=this.charReceived),b+=a.toString(this.encoding,0,e);var e=b.length-1,d=b.charCodeAt(e);if(d>=55296&&56319>=d){var f=this.surrogateSize;return this.charLength+=f,this.charReceived+=f,this.charBuffer.copy(this.charBuffer,f,0,f),a.copy(this.charBuffer,0,0,f),b.substring(0,e)}return b},j.prototype.detectIncompleteChar=function(a){for(var b=a.length>=3?3:a.length;b>0;b--){var c=a[a.length-b];if(1==b&&c>>5==6){this.charLength=2;break}if(2>=b&&c>>4==14){this.charLength=3;break}if(3>=b&&c>>3==30){this.charLength=4;break}}this.charReceived=b},j.prototype.end=function(a){var b="";if(a&&a.length&&(b=this.write(a)),this.charReceived){var c=this.charReceived,d=this.charBuffer,e=this.encoding;b+=d.slice(0,c).toString(e)}return b}},{buffer:3}],24:[function(a,b,c){function d(a,b){this._id=a,this._clearFn=b}var e=a("process/browser.js").nextTick,f=Function.prototype.apply,g=Array.prototype.slice,h={},i=0;c.setTimeout=function(){return new d(f.call(setTimeout,window,arguments),clearTimeout)},c.setInterval=function(){return new d(f.call(setInterval,window,arguments),clearInterval)},c.clearTimeout=c.clearInterval=function(a){a.close()},d.prototype.unref=d.prototype.ref=function(){},d.prototype.close=function(){this._clearFn.call(window,this._id)},c.enroll=function(a,b){clearTimeout(a._idleTimeoutId),a._idleTimeout=b},c.unenroll=function(a){clearTimeout(a._idleTimeoutId),a._idleTimeout=-1},c._unrefActive=c.active=function(a){clearTimeout(a._idleTimeoutId);var b=a._idleTimeout;b>=0&&(a._idleTimeoutId=setTimeout(function(){a._onTimeout&&a._onTimeout()},b))},c.setImmediate="function"==typeof setImmediate?setImmediate:function(a){var b=i++,d=arguments.length<2?!1:g.call(arguments,1);return h[b]=!0,e(function(){h[b]&&(d?a.apply(null,d):a.call(null),c.clearImmediate(b))}),b},c.clearImmediate="function"==typeof clearImmediate?clearImmediate:function(a){delete h[a]}},{"process/browser.js":25}],25:[function(a,b){function c(a){if(i===setTimeout)return setTimeout(a,0);try{return i(a,0)}catch(b){try{return i.call(null,a,0)}catch(b){return i.call(this,a,0)}}}function d(a){if(j===clearTimeout)return clearTimeout(a);try{return j(a)}catch(b){try{return j.call(null,a)}catch(b){return j.call(this,a)}}}function e(){n&&l&&(n=!1,l.length?m=l.concat(m):o=-1,m.length&&f())}function f(){if(!n){var a=c(e);n=!0;for(var b=m.length;b;){for(l=m,m=[];++o1)for(var d=1;d=a||a>b?i(s,n):r=setTimeout(j,a)}function k(){i(v,r)}function l(){if(m=arguments,p=e(),q=this,s=v&&(r||!w),u===!1)var c=w&&!r;else{n||w||(t=p);var d=u-(p-t),f=0>=d||d>u;f?(n&&(n=clearTimeout(n)),t=p,o=a.apply(q,m)):n||(n=setTimeout(k,d))}return f&&r?r=clearTimeout(r):r||b===u||(r=setTimeout(j,b)),c&&(f=!0,o=a.apply(q,m)),!f||r||n||(m=q=void 0),o}var m,n,o,p,q,r,s,t=0,u=!1,v=!0;if("function"!=typeof a)throw new TypeError(f);if(b=0>b?0:+b||0,c===!0){var w=!0;v=!1}else d(c)&&(w=!!c.leading,u="maxWait"in c&&g(+c.maxWait||0,b),v="trailing"in c?!!c.trailing:v);return l.cancel=h,l}var d=a("../lang/isObject"),e=a("../date/now"),f="Expected a function",g=Math.max;b.exports=c},{"../date/now":26,"../lang/isObject":55}],28:[function(a,b){function c(a,b){if("function"!=typeof a)throw new TypeError(d);return b=e(void 0===b?a.length-1:+b||0,0),function(){for(var c=arguments,d=-1,f=e(c.length-b,0),g=Array(f);++d2?c[g-2]:void 0,i=g>2?c[2]:void 0,j=g>1?c[g-1]:void 0;for("function"==typeof h?(h=d(h,j,5),g-=2):(h="function"==typeof j?j:void 0,g-=h?1:0),i&&e(c[0],c[1],i)&&(h=3>g?void 0:h,g=1);++f-1&&a%1==0&&b>a}var d=/^\d+$/,e=9007199254740991;b.exports=c},{}],46:[function(a,b){function c(a,b,c){if(!f(c))return!1;var g=typeof b;if("number"==g?d(c)&&e(b,c.length):"string"==g&&b in c){var h=c[b];return a===a?a===h:h!==h}return!1}var d=a("./isArrayLike"),e=a("./isIndex"),f=a("../lang/isObject");b.exports=c},{"../lang/isObject":55,"./isArrayLike":43,"./isIndex":45}],47:[function(a,b){function c(a){return"number"==typeof a&&a>-1&&a%1==0&&d>=a}var d=9007199254740991;b.exports=c},{}],48:[function(a,b){function c(a){return!!a&&"object"==typeof a}b.exports=c},{}],49:[function(a,b){function c(a){for(var b=i(a),c=b.length,j=c&&a.length,l=!!j&&g(j)&&(e(a)||d(a)||h(a)),m=-1,n=[];++m0,r=l.enumErrorProps&&(a===w||a instanceof Error),t=l.enumPrototypes&&g(a);++d2?arguments[2]:{},g=c(b);e&&(g=g.concat(Object.getOwnPropertySymbols(b))),d(g,function(c){j(a,c,b[c],f[c])})};k.supportsDescriptors=!!i,b.exports=k},{foreach:66,"object-keys":69}],66:[function(a,b){var c=Object.prototype.hasOwnProperty,d=Object.prototype.toString;b.exports=function(a,b,e){if("[object Function]"!==d.call(b))throw new TypeError("iterator must be a function");var f=a.length;if(f===+f)for(var g=0;f>g;g++)b.call(e,a[g],g,a);else for(var h in a)c.call(a,h)&&b.call(e,a[h],h,a)}},{}],67:[function(a,b){var c="Function.prototype.bind called on incompatible ",d=Array.prototype.slice,e=Object.prototype.toString,f="[object Function]";b.exports=function(a){var b=this;if("function"!=typeof b||e.call(b)!==f)throw new TypeError(c+b);for(var g,h=d.call(arguments,1),i=function(){if(this instanceof g){var c=b.apply(this,h.concat(d.call(arguments)));return Object(c)===c?c:this}return b.apply(a,h.concat(d.call(arguments)))},j=Math.max(0,b.length-h.length),k=[],l=0;j>l;l++)k.push("$"+l);if(g=Function("binder","return function ("+k.join(",")+"){ return binder.apply(this,arguments); }")(i),b.prototype){var m=function(){};m.prototype=b.prototype,g.prototype=new m,m.prototype=null}return g}},{}],68:[function(a,b){var c=a("./implementation");b.exports=Function.prototype.bind||c},{"./implementation":67}],69:[function(a,b){"use strict";var c=Object.prototype.hasOwnProperty,d=Object.prototype.toString,e=Array.prototype.slice,f=a("./isArguments"),g=Object.prototype.propertyIsEnumerable,h=!g.call({toString:null},"toString"),i=g.call(function(){},"prototype"),j=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],k=function(a){var b=a.constructor;return b&&b.prototype===a},l={$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},m=function(){if("undefined"==typeof window)return!1;for(var a in window)try{if(!l["$"+a]&&c.call(window,a)&&null!==window[a]&&"object"==typeof window[a])try{k(window[a])}catch(b){return!0}}catch(b){return!0}return!1}(),n=function(a){if("undefined"==typeof window||!m)return k(a);try{return k(a)}catch(b){return!1}},o=function(a){var b=null!==a&&"object"==typeof a,e="[object Function]"===d.call(a),g=f(a),k=b&&"[object String]"===d.call(a),l=[];if(!b&&!e&&!g)throw new TypeError("Object.keys called on a non-object");var m=i&&e;if(k&&a.length>0&&!c.call(a,0))for(var o=0;o0)for(var p=0;p=0&&"[object Function]"===c.call(a.callee)),d}},{}],71:[function(a,b){"use strict";var c=a("object-keys");b.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var a={},b=Symbol("test");if("string"==typeof b)return!1;var d=42;a[b]=d;for(b in a)return!1;if(0!==c(a).length)return!1;if("function"==typeof Object.keys&&0!==Object.keys(a).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(a).length)return!1;var e=Object.getOwnPropertySymbols(a);if(1!==e.length||e[0]!==b)return!1;if(!Object.prototype.propertyIsEnumerable.call(a,b))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var f=Object.getOwnPropertyDescriptor(a,b);if(f.value!==d||f.enumerable!==!0)return!1}return!0}},{"object-keys":69}],72:[function(a,b){"use strict";var c=a("object-keys"),d=a("function-bind"),e=function(a){return"undefined"!=typeof a&&null!==a},f=a("./hasSymbols")(),g=Object,h=d.call(Function.call,Array.prototype.push),i=d.call(Function.call,Object.prototype.propertyIsEnumerable);b.exports=function(a){if(!e(a))throw new TypeError("target must be an object");var b,d,j,k,l,m,n,o=g(a);for(b=1;bd;d++)i.call(a,d)&&b.call(c,a[d],d,a)}function e(a,b,c){for(var d=0,e=a.length;e>d;d++)b.call(c,a.charAt(d),d,a)}function f(a,b,c){for(var d in a)i.call(a,d)&&b.call(c,a[d],d,a)}var g=a("is-function");b.exports=c;var h=Object.prototype.toString,i=Object.prototype.hasOwnProperty},{"is-function":81}],79:[function(a,b){(function(c){var d="undefined"!=typeof c?c:"undefined"!=typeof window?window:{},e=a("min-document");if("undefined"!=typeof document)b.exports=document;else{var f=d["__GLOBAL_DOCUMENT_CACHE@4"];f||(f=d["__GLOBAL_DOCUMENT_CACHE@4"]=e),b.exports=f}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"min-document":2}],80:[function(a,b){(function(a){b.exports="undefined"!=typeof window?window:"undefined"!=typeof a?a:"undefined"!=typeof self?self:{}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],81:[function(a,b){function c(a){var b=d.call(a);return"[object Function]"===b||"function"==typeof a&&"[object RegExp]"!==b||"undefined"!=typeof window&&(a===window.setTimeout||a===window.alert||a===window.confirm||a===window.prompt)}b.exports=c;var d=Object.prototype.toString},{}],82:[function(a,b){function c(a){var b=!1;return function(){return b?void 0:(b=!0,a.apply(this,arguments))}}b.exports=c,c.proto=c(function(){Object.defineProperty(Function.prototype,"once",{value:function(){return c(this)},configurable:!0})})},{}],83:[function(a,b){var c=a("trim"),d=a("for-each"),e=function(a){return"[object Array]"===Object.prototype.toString.call(a)};b.exports=function(a){if(!a)return{};var b={};return d(c(a).split("\n"),function(a){var d=a.indexOf(":"),f=c(a.slice(0,d)).toLowerCase(),g=c(a.slice(d+1));"undefined"==typeof b[f]?b[f]=g:e(b[f])?b[f].push(g):b[f]=[b[f],g]}),b}},{"for-each":78,trim:84}],84:[function(a,b,c){function d(a){return a.replace(/^\s*|\s*$/g,"")}c=b.exports=d,c.left=function(a){return a.replace(/^\s*/,"")},c.right=function(a){return a.replace(/\s*$/,"")}},{}],85:[function(a,b){"use strict";function c(a,b){for(var c=0;c0&&(o=setTimeout(function(){n=!0,k.abort("timeout");var a=new Error("XMLHttpRequest timeout");a.code="ETIMEDOUT",e(a)},a.timeout)),k.setRequestHeader)for(m in s)s.hasOwnProperty(m)&&k.setRequestHeader(m,s[m]);else if(a.headers&&!d(a.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in a&&(k.responseType=a.responseType),"beforeSend"in a&&"function"==typeof a.beforeSend&&a.beforeSend(k),k.send(r),k}function h(){}var i=a("global/window"),j=a("once"),k=a("is-function"),l=a("parse-headers"),m=a("xtend");b.exports=f,f.XMLHttpRequest=i.XMLHttpRequest||h,f.XDomainRequest="withCredentials"in new f.XMLHttpRequest?f.XMLHttpRequest:i.XDomainRequest,c(["get","put","post","patch","head","delete"],function(a){f["delete"===a?"del":a]=function(b,c,d){return c=e(b,c,d),c.method=a.toUpperCase(),g(c)}})},{"global/window":80,"is-function":81,once:82,"parse-headers":83,xtend:86}],86:[function(a,b){function c(){for(var a={},b=0;br;r++){for(var s=i.samples[r],t=n+q+s.sample_composition_time_offset,u=h["default"].findCea608Nalus(o,m,s.sample_size),v=0;vx;x++)w[x].length>0&&f(p.fields[x],t,w[x]);q+=s.sample_duration,m+=s.sample_size}return p.startTime=n,p.endTime=n+q,p}function f(a,b,c){var d=a.length;if(d>0)if(b>=a[d-1][0])a.push([b,c]);else{for(var e=-1,f=d-1;f>=0&&!(b>a[f][0]);f--)e=f;e>=0&&a.splice(e,0,[b,c])}else a.push([b,c])}c.__esModule=!0;var g=a("./lib/cea608-parser.js"),h=d(g),i=a("./models/ccData.js"),j=d(i),k={extractCea608Data:e};c["default"]=k,b.exports=c["default"]},{"./lib/cea608-parser.js":90,"./models/ccData.js":94}],89:[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")}c.__esModule=!0;var f=a("stream"),g=d(f),h=a("global/window"),i=d(h),j=a("./lib/cea608-parser.js"),k=d(j),l=a("./lib/cea608-towebvtt.js"),m=d(l),n=a("./models/captionsBuffer.js"),o=d(n),p=function(){function a(){e(this,a),this.videoTimeScale=0,this.embeddedCea608FieldParsers=[],this.presentationTimeOffsetInSec=0,this.cueParser=new i["default"].WebVTT.Parser(i["default"],i["default"].vttjs,i["default"].WebVTT.StringDecoder()),this.cueParser.onparsingerror=function(a){return AMP.Logger.error(AMP.Logger.Area.cea608Module,"CEA608 module: an error happened: "+a)}}return a.prototype.reset=function(){this.embeddedCea608FieldParsers.forEach(function(a){return a.reset()})},a.prototype.addCcDataToFieldParsers=function(a,b,c){function d(a){var b=a.fetch("mdhd"),d=1e7;return b?b.timescale:c?c:d}if(a){this.videoTimeScale=this.videoTimeScale||d(b);for(var e=0;e=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.posb;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,b.push(a?"Row "+e+': "'+g+'"':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)},{}],91:[function(a,b,c){"use strict";c.__esModule=!0;var d=a("./cea608-parser.js"),e=function(a,b,c){this.stream=a,this.channelNr=1|b,this.combineConsecutiveRows=c|!0,this.initWritten=!1};e.prototype={newCue:function(a,b,c){this.initWritten||this.writeInit();var d=this.formatTime(a),e=this.formatTime(b);this.writeCue(d,e,c)},writeToStream:function(a){this.stream&&this.stream.write(a)},formatTime:function(a){var b,c,d,e=Math.floor(a),f=a-e,g=function(a){var b=a.toString();return 1===b.length?"0"+b:b},h=function(a){for(var b=a.toString(),c=3-b.length;c>0;)b="0"+b,c--;return b};return b=Math.floor(e/3600),e-=3600*b,c=Math.floor(e/60),e-=60*c,d=Math.floor(1e3*f),g(b)+":"+g(c)+":"+g(e)+"."+h(d)},writeInit:function(a,b){this.writeToStream("WEBVTT\nStyling=CEA608\nKind=Caption\nChannel=CC"+this.channelNr+"\n"),b&&(this.lastScreen.copy(b),this.lastTime=a),this.initWritten=!0},writeCue:function(a,b,c){for(var d=-2,e=0;e "+b+" line:"+g+"\n")}this.outputTextRow(f),this.writeToStream("\n"),d=e}}},outputTextRow:function(a){for(var b=new d.PenState,c=null,e=null,f=0;f"),g=!0),c.underline!==b.underline&&b.underline&&this.writeToStream(""),c.italics!==b.italics&&b.italics&&this.writeToStream(""),c.italics!==b.italics&&(c.italics&&this.writeToStream(""),b.italics=c.italics),c.underline!==b.underline&&c.underline&&this.writeToStream(""),g&&("white"!==c.foreground||"black"!==c.background||c.flash)){var h=[],i=c.background;if("transparent"===c.background)h.push("transparent");else{var j=i.split("_");2===j.length&&"semi"===j[1]&&h.push("semi-transparent"),"black"!==i&&h.push("bg_"+j[0])}"white"!==c.foreground&&h.push(c.foreground),c.flash&&h.push("blink");var k=h.join(".");this.writeToStream("")}this.writeToStream(e.uchar),b.copy(c)}("white"!==c.foreground||"black"!==c.background)&&this.writeToStream(""),c.underline&&this.writeToStream(""),c.italics&&this.writeToStream("")},close:function(){this.stream&&(this.stream.end(),this.stream=null)}},c["default"]=e,b.exports=c["default"]},{"./cea608-parser.js":90}],92:[function(a,b,c){/*! codem-isoboxer v0.2.10 https://github.com/madebyhiro/codem-isoboxer/blob/master/LICENSE.txt */ "use strict";var d={};d.parseBuffer=function(a){return new e(a).parse()},d.addBoxParser=function(a,b){"string"==typeof a&&"function"==typeof b&&(f.prototype._boxParsers[a]=b)},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,c,d=null;switch(a){case 8:d=this._raw.getUint8(this._cursor.offset-this._raw.byteOffset);break;case 16:d=this._raw.getUint16(this._cursor.offset-this._raw.byteOffset);break;case 24:b=this._raw.getUint16(this._cursor.offset-this._raw.byteOffset),c=this._raw.getUint8(this._cursor.offset-this._raw.byteOffset+2),d=(b<<8)+c;break;case 32:d=this._raw.getUint32(this._cursor.offset-this._raw.byteOffset);break;case 64:b=this._raw.getUint32(this._cursor.offset-this._raw.byteOffset),c=this._raw.getUint32(this._cursor.offset-this._raw.byteOffset+4),d=b*Math.pow(2,32)+c}return this._cursor.offset+=a>>3,d},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="";this._cursor.offset-this._offset0?a:this._raw.byteLength-(this._cursor.offset-this._offset),c=new DataView(this._raw.buffer,this._cursor.offset,b);return this._cursor.offset+=b,c},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||(-1!==this._boxContainers.indexOf(this.type)?this._parseContainerBox():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._parseContainerBox=function(){for(this.boxes=[];this._cursor.offset-this._raw.byteOffsetb;b++)this._readUint(8);this.depth=this._readUint(16),this.pre_defined3=this._readInt(16),this.config=this._readData()},f.prototype._boxParsers.dref=function(){this._parseFullBox(),this.entry_count=this._readUint(32),this.entries=[];for(var a=0;a>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.mehd=function(){this._parseFullBox(),this.fragment_duration=this._readUint(1==this.version?64:32)},f.prototype._boxParsers.mfhd=function(){this._parseFullBox(),this.sequence_number=this._readUint(32)},f.prototype._boxParsers.mfro=function(){this._parseFullBox(),this.mfra_size=this._readUint(32)},f.prototype._boxParsers.mp4a=function(){this.reserved1=[this._readUint(8),this._readUint(8),this._readUint(8),this._readUint(8),this._readUint(8),this._readUint(8)],this.data_reference_index=this._readUint(16),this.reserved2=[this._readUint(32),this._readUint(32)],this.channelcount=this._readUint(16),this.samplesize=this._readUint(16),this.pre_defined=this._readUint(16),this.reserved3=this._readUint(16),this.samplerate=this._readTemplate(32),this.esds=this._readData()},f.prototype._boxParsers.mvhd=function(){this._parseFullBox();var a;for(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=[],a=0;9>a;a++)this.matrix.push(this._readTemplate(32));for(this.pre_defined=[],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.smhd=function(){this._parseFullBox(),this.balance=this._readTemplate(16),this.reserved=this._readUint(16)},f.prototype._boxParsers.ssix=function(){this._parseFullBox(),this.subsegment_count=this._readUint(32),this.subsegments=[];for(var a=0;a>>6,this.length_size_of_traf_num=(this._packed&&0xffff00000000)>>>4,this.length_size_of_trun_num=(this._packed&&4294901760)>>>2,this.length_size_of_sample_num=this._packed&&255,this.number_of_entry=this._readUint(32),this.entries=[];for(var a=0;aa;a++)this.matrix.push(this._readTemplate(32));this.width=this._readTemplate(32),this.height=this._readTemplate(32)},f.prototype._boxParsers.trex=function(){this._parseFullBox(),this.track_ID=this._readUint(32),this.default_sample_description_index=this._readUint(32),this.default_sample_duration=this._readUint(32),this.default_sample_size=this._readUint(32),this.default_sample_flags=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;aa&&this.trigger("rewind"),this):b},L["default"].prototype.presentationTimeOffsetInSec=function(){return this.techGet_("presentationTimeOffsetInSec")},L["default"].prototype.currentMediaTime=function(){return this.techGet_("currentMediaTime")},L["default"].prototype.currentVideoStreamList=function(){return this.techGet_("currentVideoStreamList")},L["default"].prototype.currentAudioStreamList=function(){return this.techGet_("currentAudioStreamList")},L["default"].prototype.videoBufferData=function(){return this.techGet_("videoBufferData")},L["default"].prototype.audioBufferData=function(){return this.techGet_("audioBufferData")},L["default"].prototype.currentDownloadBitrate=function(){return this.techGet_("currentDownloadBitrate")},L["default"].prototype.currentPlaybackBitrate=function(){return this.techGet_("currentPlaybackBitrate")},L["default"].prototype.videoWidth=function(){return this.techGet_("videoWidth")},L["default"].prototype.videoHeight=function(){return this.techGet_("videoHeight")},L["default"].prototype.currentProtectionInfo=function(){return this.options_.sourceOptions.protectionInfo},L["default"].prototype.isLive=function(){return this.techGet_("isLive")},L["default"].prototype.manifestPlayableWindowLength=function(){return this.techGet_("manifestPlayableWindowLength")},L["default"].prototype.currentPlayableWindow=function(){return this.techGet_("currentPlayableWindow")},L["default"].prototype.playableWindowEndInSec=function(){return this.techGet_("playableWindowEndInSec")},L["default"].prototype.segmentBoundaries=function(){return this.techGet_("segmentBoundaries")},L["default"].prototype.toPresentationTime=function(a){return this.player().isLive()&&this.player().currentPlayableWindow()?a+this.player().currentPlayableWindow().startInSec:a},L["default"].prototype.fromPresentationTime=function(a){return this.player().isLive()&&this.player().currentPlayableWindow()?a-this.player().currentPlayableWindow().startInSec:a},L["default"].prototype.currentHeuristicProfile=function(a){return void 0===a?Z.findProfile(this.options_.heuristicProfile).name:(this.options_.heuristicProfile=a,this)},L["default"].prototype.currentPlayerSettingValue=function(a){var b=null;return this.tech_&&N["default"]._availableSettings.heuristicSettings.hasOwnProperty(a)&&(this.tech_.updateCurrentPlayerConfigs(),b=this.tech_.options_.currentPlayerConfigs.currentHeuristicConfigs[a]),b},L["default"].getScriptRootURL=function(){var a=k["default"].getElementsByTagName("script"),b=null;if(a&&a.length>=1)for(var c=a.length-1;c>=0;c--){var d=null;d=a[c].src;var e=new RegExp("(.[^?]+)/azuremediaplayer(?:\\.min)?\\.js(?:\\?.*)?$","i");if(d){var f=d.match(e);if(f&&2===f.length){b=f[1];break}}}var g=L["default"].prototype.getAmpVersion();return!b&&g&&(b=ka+g),b},L["default"].prototype.getAmpVersion=function(){var a=null;if(aa.ampVersion){var b=new RegExp("([0-9]+.[0-9]+.[0-9]+).[0-9]+"),c=aa.ampVersion.match(b);c&&2===c.length&&(a=c[1])}return a},L["default"].prototype.getFullAmpVersion=function(){return aa.ampVersion},L["default"].prototype.addThrottledWindowResizeListener=function(a,b,c){c&&(a=a.bind(c));var d=o["default"](a,b);i["default"].addEventListener("resize",d),this.on("dispose",function(){i["default"].removeEventListener("resize",d)})},L["default"].prototype.disableTextTracks=function(){var a=this.textTracks();if(a)for(var b=0;b0&&(this.options_.tracks=b),a.selected||(this.currentRetryCountForLiveMediaLoad=0,this.clearPlayerTimers(),this.options_.sdn={},Array.isArray(a)?this.options_.sourceList=a:a instanceof Object&&(this.options_.sourceList=[a]),AMP.Logger.verbose(AMP.Logger.Area.videojs,"dispatching event: sourceset "+JSON.stringify(a,function(a,b){return"authenticationToken"!==a?b:"provided"})),this.trigger(ja.eventName.sourceset),this.drmSupportCheck(this.options_.sourceList));var d=function e(){this.techSetupCheck()&&this.pluginSetupCheck()?a instanceof Object&&a.selected?(this.trigger("playerSetupCheckCompleted"),this.refreshTextTracks(),this.cache_.src=a.src,this.currentType_=a.type||"",this.options_.currentType=this.currentType_,this.techCall_("updatePlayerOptions",this.options_),this.ready(function(){this.loadMediaWithTimeout(function(){this.techCall_("src",a.src),"auto"===this.options_.preload&&this.load()})})):this.sourceList_(UrlRewriter.expandSources(this.options_.sourceList)):ia.setTimeout(e.bind(this),50)};return d.call(this),this},L["default"].prototype.vjsOptions=L["default"].prototype.options,L["default"].prototype.options=function(a){var b=this.vjsOptions(a);return this.techCall_("updatePlayerOptions",b),b},L["default"].prototype.showPlayerLoad=function(){this.removeClass("vjs-seeking"),this.removeClass("vjs-paused"),this.removeClass("vjs-playing"),this.isPreloadSupported()&&this.addClass("vjs-waiting")},L["default"].prototype.drmSupportCheck=function(a){for(var b=0,c=this.options_.techOrder;b0&&(!this.startTriggered&&b>0&&(this.startTriggered=!0,this.trigger("start")),this.isLive()||(!this.firstQuartileTriggered&&b>=a/4&&(this.firstQuartileTriggered=!0,this.trigger("firstquartile")),!this.midpointTriggered&&b>=a/2&&(this.midpointTriggered=!0,this.trigger("midpoint")),!this.thirdQuartileTriggered&&b>=3*a/4&&(this.thirdQuartileTriggered=!0,this.trigger("thirdquartile"))))}),c("play",function(){this.wasPaused&&(this.trigger("resume"),this.wasPaused=!1),this.currentRetryCountForLiveMediaLoad=0}),c("pause",function(){this.wasPaused=!0}),c("fullscreenchange",function(){this.trigger(this.isFullscreen()?"fullscreen":"exitfullscreen")}),c("canplaythrough",function(){this.clearPlayerTimers()}),c("loadstart",function(){"azurehtml5js"===this.techName_.toLowerCase()&&this.clearSetupCheckTimer()}),a.ampEventHandlersReady=!0}()},L["default"].prototype.sourceList_=function(a){var b=this.selectSource(a),c=!0;if(b&&(this.updateSourceOptions(b.source),"FlashSS"===b.tech&&void 0!==this.options_.sourceOptions.protectionInfo)){var d=R["default"].getTech(b.tech);d.isVersionSupported("30.0")===!0&&d.isVersionSupported("30.0.0.145")===!1&&(c=!1)}c&&b?(this.tech_&&b.tech===this.techName_&&("FlashSS"!==b.tech||JSON.stringify(this.options_.sourceOptions.protectionInfo)===JSON.stringify(b.source.protectionInfo)&&!this.tech_.isReloadNeeded())?(b.source.selected=!0,this.src(b.source,[],this.presentationFlow)):this.loadMediaWithTimeout(function(){this.loadTech_(b.tech,b.source),this.refreshTextTracks()}),this.cea608Module&&this.cea608Module.dispose(),this.cea608Module=this.cea608Module||new ha["default"](this),this.cea608Module.init(),"AzureHtml5JS"===this.techName_&&this.prepareForImsc1Captions(!0)):(this.tech_&&this.unloadTech_(),L["default"].raiseError.call(this,L["default"].getAMPErrorCode.call(this,a)),this.triggerReady())},L["default"].prototype.options_.sourceOptions={},L["default"].prototype.updateSourceOptions=function(a){this.options({sourceOptions:null});var b={};a&&a.protectionInfo&&(b.protectionInfo=a.protectionInfo),this.options({sourceOptions:b})},L["default"].prototype.pauseAndHide=function(){try{this.el().style.display="none",null!==this.currentSrc()&&this.pause()}catch(a){AMP.Logger.warning(AMP.Logger.Area.videojs,"Exception while quering currentSrc in player.pauseAndHide()")}},L["default"].prototype.hide=function(){void 0===this.el().style.opacity?this.el().style.display="none":(this.el().style.opacity=0,this.bigPlayButton.el().style.opacity=0)},L["default"].prototype.isVisible=function(){return"none"!==this.el().style.display},L["default"].prototype.playerContainer=function(){return this.multiPlayerContainerDiv},L["default"].prototype.currentClip=function(){return this.clip},L["default"].prototype.clip=null,L["default"].prototype.playClip=function(a){this.src(a.parent.source,a.parent.tracks,!0),this.clip=a,this.clip.isAd&&(this.title_=a.name)},L["default"].prototype.addMidRoll=function(a){return null===this.scheduler&&(this.scheduler=new AMP.Scheduler.Scheduler(this)),this.scheduler.addMidRoll(a)},L["default"].prototype.show=function(){this.el().style.display="block",this.el().style.opacity=1,this.bigPlayButton.el().style.opacity=1,this.setupSkipAd(),this.trigger("visibilityChange");var a=this;ia.setTimeout(function(){if(a.multiPlayerContainerDiv===k["default"].activeElement)try{a.multiPlayerContainerDiv.blur()}catch(b){AMP.Logger.warning(AMP.Logger.Area.videojs,"Exception while removing focus from player container")}},100)},L["default"].prototype.isDisposed=function(){return null===this.el()},L["default"].prototype.resetPlayer=function(){this.error(null),this.clip=null,this.title_="",void 0!==this.skipAdButton&&null!==this.skipAdButton&&(this.skipAdButton.style.display="none",this.skipAdButton.innerHTML="")},L["default"].prototype.setupSkipAd=function(){if(null!==this.clip&&this.clip.isAd&&this.clip.skippable&&this.clip.skippable>0){var a=this,b=function(){if(null!==a.clip&&a.skipAdInitialized){var b=a.duration()>0?Math.min(a.clip.skippable,a.duration()):a.clip.skippable,c=Math.ceil(b-a.currentTime());c>0?a.skipAdButton.innerHTML=AMP.Misc.formatString(a.localize("SKIP_AD_COUNTDOWN_FORMAT"),c):-1===(" "+a.skipAdButton.className+" ").indexOf(" enabled ")&&(a.skipAdButton.className+=" enabled",a.skipAdButton.innerHTML=a.localize("SKIP")),"block"!==a.skipAdButton.style.display&&a.currentTime()>0&&(a.skipAdButton.style.display="block"); }},c=function d(){a.skipAdInitialized=!1,a.off("timeupdate",b),a.off("ended",d),a.skipAdButton.className="amp-skip-ad-button",a.skipAdButton.style.display="none"};this.skipAdButton||(this.skipAdButton=i["default"].document.createElement("div"),this.skipAdButton.className="amp-skip-ad-button",this.skipAdButton.style.display="none",this.skipAdButton.onclick=function(){(" "+this.className+" ").indexOf(" enabled ")>=0&&(a.trigger("skip"),c())},this.el().appendChild(this.skipAdButton)),this.skipAdInitialized||(this.on("timeupdate",b),this.on("ended",c),this.skipAdInitialized=!0)}else this.skipAdButton&&(this.skipAdButton.style.display="none")},L["default"].prototype.getSkipButton=function(){return this.skipAdButton},L["default"].prototype.showControls=function(){this.controlBar.el_.style.display="none"},L["default"].prototype.hideControls=function(){this.controlBar.el_.style.display="block"},L["default"].prototype.scheduler=null,L["default"].prototype.getScheduler=function(){return this.scheduler},L["default"].prototype.playlist=function(a){return a?(null===this.scheduler&&(this.scheduler=new AMP.Scheduler.Scheduler(this)),void this.scheduler.setPlaylist(a)):this.scheduler?this.scheduler.playlist():null},L["default"].prototype.oldDispose=L["default"].prototype.dispose,L["default"].prototype.dispose=function(){this.clearPlayerTimers(),this.scheduler&&null!==this.scheduler&&this.scheduler.dispose(),this.oldDispose()},L["default"].prototype.getMemoryLog=function(a){return AMP.Logger.getMemoryLog(a)},L["default"].prototype.saveMemoryLog=function(){return AMP.Logger.saveMemoryLog()},L["default"].prototype.getSavedMemoryLog=function(){return AMP.Logger.getSavedMemoryLog()},L["default"].prototype.setXmlHttpRequestFactory=function(a){this.tech_&&this.tech_.setXmlHttpRequestFactory?this.tech_.setXmlHttpRequestFactory(a):AMP.Logger.warning(AMP.Logger.Area.videojs,"setXmlHttpRequestFactory unavailable on "+this.techName_+" playback technology element.")},N["default"].prototype.updatePlayerOptions=function(a){this.options_.playerOptions=U["default"](this.options_.playerOptions,a)},N["default"].prototype.updateCurrentPlayerConfigs=function(){this.options_.currentPlayerConfigs||(this.options_.currentPlayerConfigs={});var a=Z.findProfile(this.options_.playerOptions.heuristicProfile);void 0===this.options_.heuristicProfile&&a&&(this.options_.heuristicProfile=a.name);var b=a?m["default"]({},a):{},c=this.options_.playerOptions.customPlayerSettings;if(c&&c.customHeuristicSettings){var d={};for(var e in c.customHeuristicSettings)N["default"]._availableSettings.heuristicSettings.hasOwnProperty(e)&&(d[e]=c.customHeuristicSettings[e]);b=m["default"](b,d)}b.maxBufferInWallClockSec0;)this.removeRemoteTextTrack(this.remoteTextTracks().tracks_[0]);for(var a=this.options_.tracks||[],b=0;b1&&S.Log.warning(AMP.Logger.Area.ttml,"Only 1 IMSC1 track is currently supported.");var c=this;b.forEach(function(b){if(b.label&&void 0!==b.srclang){var d=c.addRemoteTextTrack({kind:"captions",label:b.label,srclang:b.srclang});d&&d.track?(d.track.isImsc1=!0,a&&(d.track.mode="showing")):AMP.Logger.error(AMP.Logger.Area.ttml,"Unable to create IMSC1 track: "+JSON.stringify(b)),c.textTrackSettings.setValues({justification:"left"})}else AMP.Logger.error(AMP.Logger.Area.ttml,"IMSC1 label or srclang is missing: "+JSON.stringify(b))})}},L["default"].prototype.getErrorUI=function(a){var b=ja.levelTwoErrors[268435455&a.code];if(b&&b.length>0)return b;var c=267386880,d=(a.code&c)>>20;return 0===d?a.message:6===d?this.options().notSupportedMessage:255===d?"MEDIA_ERR_UNKNOWN":H["default"].errorTypes[d]||""},F["default"].prototype.content=function(){var a=this.player().error();if(a){var b=this.player().getErrorUI(a);return[this.htmlEncode(this.localize(b)),k["default"].createElement("br"),"(0x"+a.code.toString(16)+")"]}},L["default"].getAMPErrorCode=function(a){for(var b=ja.errorCode.srcPlayerMismatchUnknown,c=0,d=this.options_.techOrder;c0&&a.forEach(function(a){a.protectionInfo&&a.protectionInfo.length>0&&a.protectionInfo.forEach(function(a){"Widevine"===a.type&&(b=!0)})}),b};try{d(this.options_.sourceList)&&(a.code=4278190080&a.code|ja.errorCode.encryptErrDecrypterNotFound)}catch(a){AMP.Logger.warning(AMP.Logger.Area.videojs,"exception in checkWidewineHttpsErrorScenario")}}},L["default"].prototype.preloadClip=function(a){this.options_.preload="auto",this.options_.autoplay=!1,this.src(a.parent.source,a.parent.tracks,!0),this.clip=a,this.clip.isAd&&(this.title_=a.name)},L["default"].prototype.canControlPlaybackRate=function(){return this.tech_&&this.tech_.featuresPlaybackRate},L["default"].prototype.isPreloadSupported=function(){return this.tech_&&this.tech_.featuresPreload},L["default"].prototype.downloadableMedia=function(a){return void 0!==a?(this.downloadableMediaOptions=a,this.trigger("downloadableMediaChanged"),this):this.downloadableMediaOptions},L["default"].prototype.spliceWaiting=function(){var a=[];if(this.tech){var b=this.techGet_("getAdSignalsAndReset");if(b&&b.length>0){var c=!!b[0].simpleSignal;b.forEach(function(b){if(c)a.push({id:b.simpleSignal.id,startOffset:b.simpleSignal.presentationTime,duration:b.simpleSignal.duration,out:!0});else{var d=AMP.Scte35Parser.parseBinaryMessage(b.scteSignal.signalInBinary);d&&d.id&&(b.scteSignal.presentationTimeOverride&&(d.startOffset=b.scteSignal.presentationTimeOverride),a.push(d))}})}}return a},L["default"].prototype.addElClass=function(a,b){v.addElClass(a,b)},L["default"].prototype.removeElClass=function(a,b){v.removeElClass(a,b)},L["default"].prototype.showBusy=function(){v.addElClass(this.el(),"vjs-waiting"),this.trigger("waiting")},L["default"].prototype.presentationLayout=function(a){return void 0===a?this.preLayout:(this.title_="",this.preLayout=a,this.clip=null,void this.trigger("presentationUpdate"))},L["default"].prototype.createAdPlayer=function(){var a=k["default"].createElement("video");B.isMobile||v.setElAttributes(a,{preload:"auto"}),this.el().parentNode.appendChild(a);var b=this.options_,c={};c.width=b.width,c.height=b.height,c.fluid=b.fluid,c.autoplay=b.autoplay,c.poster=b.poster,c.controls=!1,c.adClickEnabled=!0,c.overrideDisabledForBigPlayButton=!0,c.techOrder=["html5"],c.hotkeys={enableSeek:!1,enablePlayPause:!1},c.isAdPlayer=!0,c.logo={enabled:!1},c.ariaLabel="Ad player";var d=new L["default"](a,c,null,this);return d},S.Log.logByType=AMP.Logger.videoJSLogOverride,D["default"].prototype.prependChild=function(a,b){var c=this.addChild(a,b);return this.contentEl().insertBefore(c.el(),this.contentEl().firstChild),c},D["default"].prototype.toggleClass=function(a,b){return void 0!==b?void(b?this.addClass(a):this.removeClass(a)):void(this.hasClass(a)?this.removeClass(a):this.addClass(a))},D["default"].prototype.addCrossOriginPolicy=function(a,b){b||(b=this.el()),a===ja.CorsConfig.UseCredentials?b.setAttribute("crossorigin","use-credentials"):a===ja.CorsConfig.Anonymous&&b.setAttribute("crossorigin","anonymous")},J["default"].prototype.prependItem=function(a,b){this.prependChild(a),a.parent=b,a.on("click",t.bind(this,function(){this.unlockShowing()}))},b.exports=c["default"]},{"./Cea608/Cea608Module.js":87,"./ampDefs.js":97,"./ampHeuristicProfiles.js":98,"./lang/languages.js":124,"./tech-wrappers/Html5.js":150,"./tech-wrappers/amp-tech-azureHtml5JS.js":152,"./tech-wrappers/amp-tech-flashSS.js":153,"./tech-wrappers/amp-tech-html5FairPlayHLS.js":154,"./tech-wrappers/amp-tech-silverlightSS.js":155,"./version.js":156,"./video.js/src/js/component.js":163,"./video.js/src/js/error-display.js":200,"./video.js/src/js/media-error.js":205,"./video.js/src/js/menu/menu.js":208,"./video.js/src/js/player.js":210,"./video.js/src/js/tech/tech.js":222,"./video.js/src/js/tracks/text-track.js":233,"./video.js/src/js/utils/browser.js":239,"./video.js/src/js/utils/dom.js":242,"./video.js/src/js/utils/events.js":243,"./video.js/src/js/utils/fn.js":244,"./video.js/src/js/utils/guid.js":247,"./video.js/src/js/utils/languageLabels.js":249,"./video.js/src/js/utils/log.js":250,"./video.js/src/js/utils/merge-options.js":251,"./video.js/src/js/utils/to-title-case.js":255,"./video.js/src/js/utils/url.js":256,"./video.js/src/js/video.js":257,"global/document":79,"global/window":80,"lodash-compat/function/throttle":29,"object.assign":73,timers:24}],97:[function(a,b,c){"use strict";c.__esModule=!0;var d={PlayReady:"PlayReady",Widevine:"Widevine",AES:"AES",FairPlay:"FairPlay"};c.protectionType=d;var e={Anonymous:"Anonymous",UseCredentials:"UseCredentials"};c.CorsConfig=e;var f={Smooth:"application/vnd.ms-sstr+xml",Dash:"application/dash+xml",HLS:"application/vnd.apple.mpegurl"};c.StreamingFormatMimeType=f;var g={canplaythrough:"canplaythrough",durationchange:"durationchange",ended:"ended",error:"error",fullscreenchange:"fullscreenchange",loadstart:"loadstart",loadedmetadata:"loadedmetadata",loadeddata:"loadeddata",pause:"pause",play:"play",playing:"playing",seeked:"seeked",seeking:"seeking",timeupdate:"timeupdate",volumechange:"volumechange",waiting:"waiting",downloadbitratechanged:"downloadbitratechanged",playbackbitratechanged:"playbackbitratechanged",sourceset:"sourceset",ratechange:"ratechange",disposing:"disposing",splicewaiting:"splicewaiting",emsgAvailable:"emsgAvailable",start:"start",firstquartile:"firstquartile",midpoint:"midpoint",thirdquartile:"thirdquartile",complete:"complete",mute:"mute",unmute:"unmute",rewind:"rewind",resume:"resume",fullscreen:"fullscreen",exitfullscreen:"exitfullscreen",click:"tech-click",skip:"skip",errorInPlayingAd:"errorInPlayingAd",livestartupretry:"livestartupretry",embeddedcaptionsfound:"embeddedcaptionsfound",decryptorInitialized:"decryptorInitialized"};c.eventName=g;var h={menuadded:"menuadded",currentTimeChanging:"currentTimeChanging",playingAtLiveDVREdge:"playingAtLiveDVREdge",playingAtStartDVREdge:"playingAtStartDVREdge",playingInDVR:"playingInDVR"};c.internalEventName=h;var i={trackselected:"trackselected"};c.streamEventName=i;var j={streamselected:"streamselected",streamindexinvalid:"streamindexinvalid",streamselectnotsupported:"streamselectnotsupported"};c.streamListEventName=j;var k={abortedErrStart:1048576,abortedErrUnknown:1048576,abortedErrNotImplemented:1048577,abortedErrHttpMixedContentBlocked:1048578,abortedErrEnd:2097151,networkErrStart:2097152,networkErrUnknown:2097152,networkErrHttpResponseBegin:2097552,networkErrHttpBadUrlFormat:2097552,networkErrHttpUserAuthRequired:2097553,networkErrHttpUserForbidden:2097555,networkErrHttpUrlNotFound:2097556,networkErrHttpNotAllowed:2097557,networkErrHttpGone:2097562,networkErrHttpPreconditionFailed:2097564,networkErrHttpInternalServerFailure:2097652,networkErrHttpBadGateway:2097654,networkErrHttpServiceUnavailable:2097655,networkErrHttpGatewayTimeout:2097656,networkErrHttpResponseEnd:2097751,networkErrTimeout:2097752,networkErrError:2097753,networkErrAbort:2097754,networkErrNoInternet:2097755,networkErrEnd:3145727,decodeErrStart:3145728,decodeErrUnknown:3145728,decodeErrEnd:4194303,srcErrStart:4194304,srcErrUnknown:4194304,srcErrParsePresentation:4194305,srcErrParseSegment:4194306,srcErrUnsupportedPresentation:4194307,srcErrInvalidSegment:4194308,srcErrLiveNoSegments:4194309,srcErrEnd:5242879,encryptErrStart:5242880,encryptErrUnknown:5242880,encryptErrDecrypterNotFound:5242881,encryptErrDecrypterInit:5242882,encryptErrDecrypterNotSupported:5242883,encryptErrKeyAcquire:5242884,encryptErrDecryption:5242885,encryptErrLicenseAcquire:5242886,encryptErrEnd:6291455,srcPlayerMismatchStart:6291456,srcPlayerMismatchUnknown:6291456,srcPlayerMismatchFlashNotInstalled:6291457,srcPlayerMismatchSilverlightNotInstalled:6291458,srcPlayerMismatchEnd:7340031,errUnknown:267386880};c.errorCode=k;var l={400:k.networkErrHttpBadUrlFormat,401:k.networkErrHttpUserAuthRequired,403:k.networkErrHttpUserForbidden,404:k.networkErrHttpUrlNotFound,405:k.networkErrHttpNotAllowed,410:k.networkErrHttpGone,412:k.networkErrHttpPreconditionFailed,500:k.networkErrHttpInternalServerFailure,502:k.networkErrHttpBadGateway,503:k.networkErrHttpServiceUnavailable,504:k.networkErrHttpGatewayTimeout};c.httpErrorCode=l;var m={downloadrequested:"downloadrequested",downloadcompleted:"downloadcompleted",downloaddecrypted:"downloaddecrypted",downloadfailed:"downloadfailed"};c.bufferDataEventName=m;var n={video:"video",videoWithCC:"videoWithCC",audio:"audio",transcript:"transcript"};c.downloadableMediaType=n},{}],98:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a){for(var b=[{name:g["default"].HeuristicProfile.Hybrid,preRollInWallClockSec:4,maxBufferInWallClockSec:30,livePlaybackOffsetInWallClockSec:8,windowSizeHeuristics:!0},{name:g["default"].HeuristicProfile.QuickStart,preRollInWallClockSec:2,maxBufferInWallClockSec:30,livePlaybackOffsetInWallClockSec:8,windowSizeHeuristics:!0},{name:g["default"].HeuristicProfile.HighQuality,preRollInWallClockSec:8,maxBufferInWallClockSec:30,livePlaybackOffsetInWallClockSec:15,windowSizeHeuristics:!1},{name:g["default"].HeuristicProfile.LowLatency,preRollInWallClockSec:2,maxBufferInWallClockSec:30,livePlaybackOffsetInWallClockSec:2,windowSizeHeuristics:!0}],c=0;c=0;c--)this.el_.addEventListener(f["default"].Events[c],b)},f["default"].prototype.eventHandler=function(a){"timeupdate"!==a.type&&"progress"!==a.type&&.Logger.verbose(AMP.Logger.Area.html5,"Event: "+a.type),"error"===a.type&&this.error()&&d["default"].raiseError.call(this,"html5",this.error().code<<20)},f["default"].prototype.presentationTimeOffsetInSec=function(){return void 0},f["default"].prototype.vjsSetSrc=f["default"].prototype.setSrc,f["default"].prototype.setSrc=function(a){AMP.Logger.setLogConfig(this.options_.playerOptions.traceConfig),this.vjsSetSrc(a)},f["default"].prototype.isLiveStartupError=function(){var a=this.error();if(a){var b=a.code<<20;if(0===b)return!0}return!1},f["default"].prototype.currentAudioStreamList=function(){return this.audioStreamList_||(this.audioStreamList_=new AMP.Html5.AudioStreamList(this)),this.audioStreamList_}},{"../video.js/src/js/tech/html5.js":219,"../video.js/src/js/tech/tech.js":222}],151:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a){void 0===a&&(a=null);var b=!1;try{var c=null,d=!1;if(g["default"].ActiveXObject)try{c=new g["default"].ActiveXObject("AgControl.AgControl"),null===a?b=!0:c.IsVersionSupported(a)&&(b=!0),c=null}catch(e){d=!0}else d=!0;if(d){var f=g["default"].navigator.plugins["Silverlight Plug-In"];if(f)if(null===a)b=!0;else{var h=f.description;"1.0.30226.2"===h&&(h="2.0.30226.2");for(var i=h.split(".");i.length>3;)i.pop();for(;i.length<4;)i.push(0);for(var j=a.split(".");j.length>4;)j.pop();var k,l,m=0;do k=parseInt(j[m]),l=parseInt(i[m]),m++;while(m=k&&!isNaN(k)&&(b=!0)}}}catch(e){b=!1}return b}c.__esModule=!0,c.isSilverlightInstalled=e;var f=a("global/window"),g=d(f)},{"global/window":80}],152:[function(a,b,c){"use strict";function d(a){if(a&&a.__esModule)return a;var b={};if(null!=a)for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b[c]=a[c]);return b["default"]=a,b}function e(a){return a&&a.__esModule?a:{"default":a}}function f(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function g(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)}c.__esModule=!0;var h=a("global/window"),i=e(h),j=a("object.assign"),k=e(j),l=a("../video.js/src/js/tech/tech.js"),m=e(l),n=a("../video.js/src/js/tech/html5.js"),o=e(n),p=a("../video.js/src/js/component.js"),q=e(p),r=a("../video.js/src/js/player.js"),s=e(r),t=a("../video.js/src/js/video.js"),u=e(t),v=a("../video.js/src/js/utils/dom.js"),w=d(v),x=a("../video.js/src/js/utils/fn.js"),y=d(x),z=a("../video.js/src/js/utils/browser.js"),A=d(z),B=a("../ampDefs.js"),C=d(B),D=function(a){function b(c,d){f(this,b),a.call(this,c,d),this.manualTimeUpdatesOff();var e=void 0,g=void 0;this.featuresPlaybackRate=o["default"].canControlPlaybackRate(),this.fullscreenResize=!0,this.progressEvents=!1,this.volumeControl=!0,e=c.source,this.setControls(!1),AzureHtml5JSTech.Log.setLoggerFunction(AMP.Logger.writeEntry,AMP.Logger.Area.azureHtml5JS),g=AzureHtml5JSTech.CreateAzureHtml5(this.el_.videoTag_,c.playerId),c.staleDataTimeLimitInSec&&g.setStaleDataTimeLimit(c.staleDataTimeLimitInSec),this.mediaPlayer=g,this.options_.muted&&this.setMuted(!0),this.setupTriggers(g),e&&this.src!==e.src&&this.setSrc(e.src),A.TOUCH_ENABLED&&c.nativeControlsForTouch===!0&&this.setControls(!0),this.options_.playerOptions.traceConfig&&AzureHtml5JSTech.Log.setConsoleOutputByLevel(this.options_.playerOptions.traceConfig.maxLogLevel),this.triggerReady()}return g(b,a),b.prototype.dispose=function(){null!==this.mediaPlayer&&(this.mediaPlayer.dispose(),this.mediaPlayer=null),b.disposeMediaElement(this.el_),a.prototype.dispose.call(this)},b.prototype.createEl=function(){var a=this.options_.tag,c=a;if(!a||this.movingMediaElementInDOM===!1)if(a){var d=a.cloneNode(!0);a.parentNode.insertBefore(d,a),b.disposeMediaElement(a),a=d}else{a=w.createEl("div"),c=w.createEl("video");var e=this.options_.tag&&w.getElAttributes(this.options_.tag),f=k["default"]({},e);w.setElAttributes(c,k["default"](f,{id:this.options_.techId,"class":"vjs-tech"})),a.appendChild(c),a.videoTag_=c}w.setElAttributes(c,{oncontextmenu:"return false;"}),w.setElAttributes(c,{tabindex:"-1"}),w.setElAttributes(c,{"aria-hidden":"true"});for(var g=["preload","loop"],h=g.length-1;h>=0;h--){var i=g[h],j={};"undefined"!=typeof this.options_[i]&&(j[i]=this.options_[i]),w.setElAttributes(c,j)}return a},b.prototype.autoplay=function(){return this.mediaPlayer.autoplay},b.prototype.setAutoplay=function(a){this.options_.autoplay=a},b.prototype.buffered=function(){return this.mediaPlayer.buffered},b.prototype.controls=function(){return this.el_.controls},b.prototype.setControls=function(a){this.el_.controls=!!a},b.prototype.currentSrc=function(){return this.src()},b.prototype.isLive=function(){return this.mediaPlayer.isLive},b.prototype.manifestPlayableWindowLength=function(){return this.mediaPlayer.manifestPlayableWindowLength},b.prototype.currentPlayableWindow=function(){return this.mediaPlayer.currentPlayableWindow},b.prototype.playableWindowEndInSec=function(){return this.mediaPlayer.playableWindowEndInSec},b.prototype.segmentBoundaries=function(){return this.mediaPlayer.segmentBoundaries},b.prototype.setCurrentTime=function(a){this.mediaPlayer.currentTime=a},b.prototype.setCurrentAbsoluteTime=function(a){this.mediaPlayer.currentAbsoluteTime=a},b.prototype.currentTime=function(){return this.mediaPlayer.currentTime},b.prototype.currentAbsoluteTime=function(){return this.mediaPlayer.currentAbsoluteTime},b.prototype.currentMediaTime=function(){return this.mediaPlayer.currentMediaTime},b.prototype.presentationTimeOffsetInSec=function(){return this.mediaPlayer.presentationTimeOffsetInSec},b.prototype.getWallClockTime=function(a,b,c,d,e){return this.mediaPlayer.getWallClockTime(a,b,c,d,e)},b.prototype.presentationTimeFromPercentageOfDvrWindow=function(a){return this.mediaPlayer.presentationTimeFromPercentageOfDvrWindow(a)},b.prototype.currentType=function(){return this.mediaPlayer.type},b.prototype.currentVideoStreamList=function(){return this.mediaPlayer.currentVideoStreamList},b.prototype.currentAudioStreamList=function(){return this.mediaPlayer.currentAudioStreamList},b.prototype.videoBufferData=function(){return this.mediaPlayer.videoBufferData},b.prototype.audioBufferData=function(){return this.mediaPlayer.audioBufferData},b.prototype.currentDownloadBitrate=function(){return this.mediaPlayer.currentDownloadBitrate},b.prototype.currentPlaybackBitrate=function(){return this.mediaPlayer.currentPlaybackBitrate},b.prototype.duration=function(){return this.mediaPlayer.duration},b.prototype.ended=function(){return this.mediaPlayer.ended},b.prototype.isFullScreen=function(){return this.mediaPlayer.isFullScreen},b.prototype.muted=function(){return this.el_.videoTag_.muted||0===this.mediaPlayer.volume},b.prototype.setMuted=function(a){a?(this.el_.videoTag_.muted=!0,this.setVolume(0)):this.el_.videoTag_.muted=!1},b.prototype.paused=function(){return this.mediaPlayer.paused},b.prototype.seeking=function(){return this.mediaPlayer.seeking},b.prototype.src=function(a){return void 0===a?this.mediaPlayer.src:void this.setSrc(a)},b.prototype.volume=function(){return this.mediaPlayer.volume},b.prototype.setVolume=function(a){this.mediaPlayer.volume=a},b.prototype.height=function(a){return void 0===a?this.mediaPlayer.height:void(this.mediaPlayer.height=a)},b.prototype.width=function(a){return void 0===a?this.mediaPlayer.width:void(this.mediaPlayer.width=a)},b.prototype.videoHeight=function(){return this.mediaPlayer.videoHeight},b.prototype.videoWidth=function(){ return this.mediaPlayer.videoWidth},b.prototype.play=function(){this.mediaPlayer.play()},b.prototype.pause=function(){this.mediaPlayer.pause()},b.prototype.setSrc=function(a){var b={type:this.options_.playerOptions.currentType};b=k["default"]({autoPlay:!!this.options_.playerOptions.autoplay},b),b.headers=this.options_.playerOptions.headers,this.updateCurrentPlayerConfigs(),AMP.Logger.setLogConfig(this.options_.playerOptions.traceConfig),this.options_.playerOptions.traceConfig&&AzureHtml5JSTech.Log.setConsoleOutputByLevel(this.options_.playerOptions.traceConfig.maxLogLevel);var c={},d=this.options_.currentPlayerConfigs.currentHeuristicConfigs;c.maxBufferInWallClockSec=d.maxBufferInWallClockSec,c.prerollPercent=d.preRollInWallClockSec/d.maxBufferInWallClockSec,c.livePlaybackOffsetPercent=(d.livePlaybackOffsetInWallClockSec-d.preRollInWallClockSec)/d.maxBufferInWallClockSec,c.windowSizeHeuristicsEnabled=d.windowSizeHeuristics,c.useBrowserWindowForWindowSizeRule=d.useBrowserWindowForWindowSizeRule,c.minFragmentsForBandwidthAverage=d.minFragmentsForBandwidthAverage,c.bandwidthTestWithTimeThresholdDuringLive=d.bandwidthTestWithTimeThresholdDuringLive,c.useVariableFragmentSizeMode=d.useVariableFragmentSizeMode,this.options_.maxSkipSegments&&(c.maxSkipSegments=this.options_.maxSkipSegments),this.options_.maxRetryPerSegment&&(c.maxRetryPerSegment=this.options_.maxRetryPerSegment),this.options_.maxTotalRetries&&(c.maxTotalRetries=this.options_.maxTotalRetries),this.options_.infiniteSegmentRetryForPreconditionFailed&&(c.infiniteSegmentRetryForPreconditionFailed=this.options_.infiniteSegmentRetryForPreconditionFailed),"QuickStart"===this.options_.heuristicProfile&&(c.preFetchDataEnabled=!1),this.options_.maxRetriesForKeyAcquireFailure&&(c.maxRetriesForKeyAcquireFailure=this.options_.maxRetriesForKeyAcquireFailure),this.options_.maxWaitTimeBetweenRetriesForKeyAcquireMS&&(c.maxWaitTimeBetweenRetriesForKeyAcquireMS=this.options_.maxWaitTimeBetweenRetriesForKeyAcquireMS),b.userConfig=c;var e=this.options_.playerOptions.sourceOptions.protectionInfo,f=null;if(e){for(var g=0;g0?a:0,this.lastSeekTarget_=a,this.el_.setCurrentTime(a))},b.prototype.currentTime=function(){return this.seeking()?this.lastSeekTarget_||0:this.el_.getCurrentTime?this.el_.getCurrentTime():null},b.prototype.currentAbsoluteTime=function(){return void 0},b.prototype.currentMediaTime=function(){return this.el_.getCurrentMediaTime?this.el_.getCurrentMediaTime():null},b.prototype.presentationTimeOffsetInSec=function(){return void 0},b.prototype.currentVideoStreamList=function(){return b._currentVideoStreamList},b.prototype.currentAudioStreamList=function(){return b._currentAudioStreamList},b.prototype.videoBufferData=function(){return b._videoBufferData},b.prototype.audioBufferData=function(){return b._audioBufferData},b.prototype.currentDownloadBitrate=function(){if(b._currentVideoStreamList&&this.el_.getCurrentDynamicStreamIndex){var a=this.el_.getCurrentDynamicStreamIndex();return b._currentVideoStreamList.streams[0].tracks[a].bitrate}return void 0},b.prototype.currentPlaybackBitrate=function(){return void 0},b.prototype.ended=function(){return b._ended},b.prototype.isFullscreen=function(){return this.isFullscreen()},b.prototype.src=function(a){return void 0===a?this.currentSrc():void(this.el_.setAutoPlay&&this.el_.setMediaResourceURL&&(this.reset(),a=b.getFullSourceURL(a),b._src=a,this.mediaError=null,this.el_.setAutoPlay(!0),this.el_.setMediaResourceURL(a)))},b.prototype.currentSrc=function(){return b._src?b._src:this.el_.getCurrentSrc?this.el_.getCurrentSrc():null},b.prototype.load=function(){this.el_.load&&this.el_.load()},b.prototype.play=function(){this.el_.play2&&this.el_.play2()},b.prototype.pause=function(){this.el_.pause&&this.el_.pause()},b.prototype.supportsFullScreen=function(){return!1},b.prototype.enterFullScreen=function(){return!1},b.prototype.getWallClockTime=function(){return void 0},b.prototype.restartCheckMediaWorkflowIfNeeded=function(){},b}(q["default"]),L=K.prototype,M="controls,muted,volume".split(","),N="duration,paused,seeking,videoHeight,videoWidth".split(","),O=0;O.05&&!this.isLive()&&(AMP.Logger.warning(AMP.Logger.Area.flashSS," Forcing a state transition to play by pausing first."),this.pause(),this.play(),this.stateTransitionForced=!0)}catch(a){}},K.onEvent=function(a,b,c){try{var d=B.getEl(a),e=d&&d.tech;if(!e||!e.el())return void AMP.Logger.warning(AMP.Logger.Area.flashSS," Got an event from stale flashSS tech "+a+" - Event:"+b);if(-1!==K._passThroughEvents.indexOf(b)&&e.trigger(b),!e.firstPlayingOccurredWithAutoplayFalse_&&"timeupdate"===b)return void e.forcePauseToPlayStateTransition();switch(b){case"onJavaScriptBridgeCreated":K.onReady(a),e.trigger("javascriptBridgeCreated");break;case"complete":K._ended=!0,e.trigger("ended");break;case"emptied":K._firstReady&&(K._currentVideoStreamList||(K._currentVideoStreamList=new AMP.FlashSS.VideoStreamList(e.el()),K._currentAudioStreamList=new AMP.FlashSS.AudioStreamList(e.el()),0===K._currentAudioStreamList.streams.length&&(K._currentAudioStreamList=void 0)),e.trigger("loadeddata"),e.trigger("loadedmetadata"),K._firstReady=!1,e.el().setAutoDynamicStreamSwitch(!0));break;case"downloadevent":e.downloadEvent(c);break;case"play":e.options_.playerOptions.autoplay||e.firstPlayingOccurredWithAutoplayFalse_?(e.firstPlayingOccurredWithAutoplayFalse_||(e.trigger("canplaythrough"),e.firstPlayingOccurredWithAutoplayFalse_=!0),e.trigger("play"),e.trigger("playing")):(e.pause(),e.trigger("canplaythrough"),e.firstPlayingOccurredWithAutoplayFalse_=!0);break;case"pause":e.firstPlayingOccurredWithAutoplayFalse_&&e.trigger("pause");break;case"seeked":e.firstPlayingOccurredWithAutoplayFalse_&&e.trigger("seeked");break;case"timeupdate":e.firstPlayingOccurredWithAutoplayFalse_&&e.trigger("timeupdate");break;case"error":e.currentSrc()&&(e.mediaError=c.code,q["default"].raiseError.call(e,"flashss",K.getMediaErrorCode(c.code,c.detail),K.getMediaErrorMsg(c.code)),e.firstPlayingOccurredWithAutoplayFalse_=!1);break;case"switchingChange":e.trigger("downloadbitratechanged")}"timeupdate"!==b&&"progress"!==b&&.Logger.verbose(AMP.Logger.Area.flashSS,a+" - Event:"+b)}catch(f){throw AMP.Logger.error(AMP.Logger.Area.flashSS,a+" - Event:"+b+" - error:"+f),f}},K.prototype.downloadEvent=function(a){function b(a,b){!a.isAudio&&a.rawData&&(b.mediaDownload.rawSampleTimeScale=a.rawSampleTimeScale,b.mediaDownload.data=c(a.rawData),a.rawSampleTimeScale&&(b.mediaDownload.presentationTimeOffsetInSec=a.presentationTimeOffset/a.rawSampleTimeScale))}function c(a){for(var b=k["default"].atob(a),c=b.length,d=new Uint8Array(c),e=0;c>e;e++)d[e]=b.charCodeAt(e);return d.buffer}if(a&&a.type){var d=void 0;switch(a.type){case"downloadStarted":d=a.isAudio?K._audioBufferData:K._videoBufferData,d.downloadRequested=d.downloadRequested||{},d.downloadRequested.url=a.url,d.downloadRequested.bitrate=a.bitrate,d.downloadRequested.mediaTime=a.mediaTime,d.dispatchEvent(J.bufferDataEventName.downloadrequested);break;case"downloadCompleted":d=a.isAudio?K._audioBufferData:K._videoBufferData,d.downloadCompleted=d.downloadCompleted||{},d.downloadCompleted.measuredBandwidth=8*a.downloadBytes/a.downloadTime,d.downloadCompleted.totalBytes=a.downloadBytes,d.downloadCompleted.totalDownloadMs=1e3*a.downloadTime,d.downloadCompleted.mediaDownload=d.downloadCompleted.mediaDownload||{},d.downloadCompleted.mediaDownload.url=a.url,d.downloadCompleted.mediaDownload.bitrate=a.bitrate,d.downloadCompleted.mediaDownload.mediaTime=a.mediaTime,b(a,d.downloadCompleted),d.dispatchEvent(J.bufferDataEventName.downloadcompleted);break;case"downloadDecrypted":d=a.isAudio?K._audioBufferData:K._videoBufferData,d.decryptionCompleted=d.decryptionCompleted||{},d.decryptionCompleted.mediaDownload=d.downloadCompleted.mediaDownload||{},d.decryptionCompleted.mediaDownload.mediaTime=a.mediaTime,b(a,d.decryptionCompleted),d.dispatchEvent(J.bufferDataEventName.downloaddecrypted);break;case"mediaError":d=a.isAudio?K._audioBufferData:K._videoBufferData,d.downloadFailed=d.downloadFailed||{},d.downloadFailed.code=a.code,d.downloadFailed.message=a.message,d.downloadFailed.mediaDownload=d.downloadFailed.mediaDownload||{},d.downloadFailed.mediaDownload.url=a.url,d.downloadFailed.mediaDownload.bitrate=a.bitrate,d.downloadFailed.mediaDownload.mediaTime=a.mediaTime,d.dispatchEvent(J.bufferDataEventName.downloadfailed),q["default"].raiseError.call(this,"flashss",K.getMediaErrorCode(a.code,a.detail),K.getMediaErrorMsg(a.code))}}},K.getMediaErrorCode=function(a,b){switch(a){case K.errorCodes.OSMF_HTTP_GET_FAILED:case K.errorCodes.OSMF_NETCONNECTION_REJECTED:case K.errorCodes.OSMF_NETCONNECTION_APPLICATION_INVALID:case K.errorCodes.OSMF_NETCONNECTION_FAILED:case K.errorCodes.FRAGMENT_DOWNLOAD_ERROR:case K.errorCodes.MANIFEST_DOWNLOAD_ERROR:return K.getHttpErrorCode(b);case K.errorCodes.OSMF_NETCONNECTION_TIMEOUT:case K.errorCodes.MANIFEST_DOWNLOAD_TIMEOUT:case K.errorCodes.FRAGMENT_DOWNLOAD_TIMEOUT:return J.errorCode.networkErrTimeout;case K.errorCodes.MANIFEST_NOT_SUPPORTED_ELEMENT:case K.errorCodes.MANIFEST_NOT_SUPPORTED_AUDIO_TRACK:case K.errorCodes.MANIFEST_NOT_SUPPORTED_VIDEO_TRACK:case K.errorCodes.VIDEO_STREAM_MISSING:case K.errorCodes.MANIFEST_LIVE_DVRWINDOWLENGTH_TOO_SMALL:return J.errorCode.srcErrUnsupportedPresentation;case K.errorCodes.TOO_EARLY_TO_JOIN_LIVE_EVENT:return J.errorCode.srcErrLiveNoSegments;case K.errorCodes.MANIFEST_PARSE_TIMEOUT:case K.errorCodes.MANIFEST_MAJOR_VERSION_MISSING:case K.errorCodes.MANIFEST_MINOR_VERSION_MISSING:case K.errorCodes.MANIFEST_STREAMINDEX_MISSING:case K.errorCodes.MANIFEST_UNEXPECTED_ROOT_ELEMENT:case K.errorCodes.MANIFEST_UNEXPECTED_ROOT_ATTRIBUTE:case K.errorCodes.MANIFEST_STREAMINFO_TYPE_MISSING:case K.errorCodes.MANIFEST_STREAMINFO_URL_MISSING:case K.errorCodes.MANIFEST_CHUNK_ATTRIBUTE_MISSING:case K.errorCodes.MANIFEST_INVALID_ATTRIBUTE_VALUE:case K.errorCodes.INVALID_SMOOTH_DYNAMIC_RESOURCE:case K.errorCodes.MANIFEST_AUDIO_QUALITYLEVEL_BITRATE_MISSING:case K.errorCodes.MANIFEST_AUDIO_QUALITYLEVEL_AUDIOTAG_MISSING:case K.errorCodes.MANIFEST_VIDEO_QUALITYLEVEL_BITRATE_MISSING:case K.errorCodes.MANIFEST_VIDEO_QUALITYLEVEL_FOURCC_MISSING:case K.errorCodes.MANIFEST_VIDEO_QUALITYLEVEL_MAXWIDTH_MISSING:case K.errorCodes.MANIFEST_VIDEO_QUALITYLEVEL_MAXHEIGHT_MISSING:case K.errorCodes.MANIFEST_UNEXPECTED_PROTECTION_HEADER:case K.errorCodes.MANIFEST_LIVE_LOOKAHEADFRAGMENTCOUNT_MISSING:return J.errorCode.srcErrParsePresentation;case K.errorCodes.OSMF_NETSTREAM_PLAY_FAILED:case K.errorCodes.OSMF_NETSTREAM_FILE_STRUCTURE_INVALID:case K.errorCodes.OSMF_IO_ERROR:case K.errorCodes.OSMF_SECURITY_ERROR:case K.errorCodes.OSMF_ASYNC_ERROR:case K.errorCodes.OSMF_ARGUMENT_ERROR:case K.errorCodes.OSMF_URL_SCHEME_INVALID:case K.errorCodes.OSMF_MEDIA_LOAD_FAILED:case K.errorCodes.OSMF_PLUGIN_VERSION_INVALID:case K.errorCodes.OSMF_PLUGIN_IMPLEMENTATION_INVALID:case K.errorCodes.OSMF_SOUND_PLAY_FAILED:case K.errorCodes.OSMF_NETSTREAM_STREAM_NOT_FOUND:case K.errorCodes.OSMF_DVRCAST_SUBSCRIBE_FAILED:case K.errorCodes.OSMF_DVRCAST_CONTENT_OFFLINE:case K.errorCodes.OSMF_DVRCAST_STREAM_INFO_RETRIEVAL_FAILED:case K.errorCodes.OSMF_F4M_FILE_INVALID:case K.errorCodes.CANNOT_SET_AUDIO_STREAM_INDEX:case K.errorCodes.PLUGIN_INVALID_PARAM:case K.errorCodes.PLUGIN_NULL_PARAM:return J.errorCode.srcErrUnknown;case K.errorCodes.ENCRYPTIONKEY_DOWNLOAD_ERROR:case K.errorCodes.ENCRYPTIONKEY_DOWNLOAD_AUTH_ERROR:case K.errorCodes.ENCRYPTIONKEY_DOWNLOAD_TIMEOUT:case K.errorCodes.ENCRYPTIONKEYURL_TOKEN_VERIFICATION_ERROR:return J.errorCode.encryptErrKeyAcquire;case K.errorCodes.FRAGMENT_DECRYPT_ERROR:return J.errorCode.encryptErrDecryption;default:return J.errorCode.errUnknown}},K.getHttpErrorCode=function(a){var b=J.errorCode.networkErrUnknown;if(a){var c=a.match(/^httpStatus:([0-9]+)/);2===c.length&&(b=J.httpErrorCode[c[1]]||b)}return b},K.errorCodes={OSMF_IO_ERROR:1,OSMF_SECURITY_ERROR:2,OSMF_ASYNC_ERROR:3,OSMF_ARGUMENT_ERROR:4,OSMF_URL_SCHEME_INVALID:5,OSMF_HTTP_GET_FAILED:6,OSMF_MEDIA_LOAD_FAILED:7,OSMF_PLUGIN_VERSION_INVALID:8,OSMF_PLUGIN_IMPLEMENTATION_INVALID:9,OSMF_SOUND_PLAY_FAILED:10,OSMF_NETCONNECTION_REJECTED:11,OSMF_NETCONNECTION_APPLICATION_INVALID:12,OSMF_NETCONNECTION_FAILED:13,OSMF_NETCONNECTION_TIMEOUT:14,OSMF_NETSTREAM_PLAY_FAILED:15,OSMF_NETSTREAM_STREAM_NOT_FOUND:16,OSMF_NETSTREAM_FILE_STRUCTURE_INVALID:17,OSMF_NETSTREAM_NO_SUPPORTED_TRACK_FOUND:18,OSMF_DRM_SYSTEM_UPDATE_ERROR:19,OSMF_DVRCAST_SUBSCRIBE_FAILED:20,OSMF_DVRCAST_CONTENT_OFFLINE:21,OSMF_DVRCAST_STREAM_INFO_RETRIEVAL_FAILED:22,OSMF_F4M_FILE_INVALID:23,MANIFEST_DOWNLOAD_TIMEOUT:1e3,MANIFEST_PARSE_TIMEOUT:1001,MANIFEST_DOWNLOAD_ERROR:1002,MANIFEST_MAJOR_VERSION_MISSING:1003,MANIFEST_MINOR_VERSION_MISSING:1004,MANIFEST_STREAMINDEX_MISSING:1005,MANIFEST_UNEXPECTED_ROOT_ELEMENT:1006,MANIFEST_UNEXPECTED_ROOT_ATTRIBUTE:1007,MANIFEST_STREAMINFO_TYPE_MISSING:1008,MANIFEST_STREAMINFO_URL_MISSING:1009,MANIFEST_AUDIO_QUALITYLEVEL_BITRATE_MISSING:1010,MANIFEST_AUDIO_QUALITYLEVEL_AUDIOTAG_MISSING:1011,MANIFEST_VIDEO_QUALITYLEVEL_BITRATE_MISSING:1012,MANIFEST_VIDEO_QUALITYLEVEL_FOURCC_MISSING:1013,MANIFEST_VIDEO_QUALITYLEVEL_MAXWIDTH_MISSING:1014,MANIFEST_VIDEO_QUALITYLEVEL_MAXHEIGHT_MISSING:1015,MANIFEST_CHUNK_ATTRIBUTE_MISSING:1016,MANIFEST_NOT_SUPPORTED_ELEMENT:1017,MANIFEST_NOT_SUPPORTED_AUDIO_TRACK:1018,MANIFEST_NOT_SUPPORTED_VIDEO_TRACK:1019,MANIFEST_INVALID_ATTRIBUTE_VALUE:1020,INVALID_SMOOTH_DYNAMIC_RESOURCE:1021,FRAGMENT_DOWNLOAD_TIMEOUT:1022,FRAGMENT_DOWNLOAD_ERROR:1023,CANNOT_SET_AUDIO_STREAM_INDEX:1024,VIDEO_STREAM_MISSING:1025,MANIFEST_LIVE_LOOKAHEADFRAGMENTCOUNT_MISSING:1026,PLUGIN_INVALID_PARAM:1027,PLUGIN_NULL_PARAM:1028,MANIFEST_LIVE_DVRWINDOWLENGTH_TOO_SMALL:1029,TOO_EARLY_TO_JOIN_LIVE_EVENT:1030,MANIFEST_UNEXPECTED_PROTECTION_HEADER:1048,ENCRYPTIONKEY_DOWNLOAD_ERROR:1049,ENCRYPTIONKEY_DOWNLOAD_AUTH_ERROR:1050,ENCRYPTIONKEY_DOWNLOAD_TIMEOUT:1051,ENCRYPTIONKEYURL_TOKEN_VERIFICATION_ERROR:1052,FRAGMENT_DECRYPT_ERROR:1053},K.getMediaErrorMsg=function(a){for(var b in K.errorCodes)if(K.errorCodes.hasOwnProperty(b)&&K.errorCodes[b]===a)return b;return a},K.getFullSourceURL=function(a){return a=H.getAbsoluteURL(a),0===a.indexOf("//")&&(a=k["default"].location.protocol+a),a},K.prototype.reset=function(){K._firstReady=!0,K._ended=!1,K._src=null,K._currentVideoStreamList=void 0,K._currentAudioStreamList=void 0,this.flashSS.firstPlayingOccurredWithAutoplayFalse_=!1,this.stateTransitionForced=!1},K.prototype.setPlaybackRate=function(){},K.prototype.isReloadNeeded=function(){var a=this.options_.currentPlayerConfigs;return null!=K._src&&a&&a.currentHeuristicConfigs&&K._heuristicSettings.minimumBufferTimeInSeconds===a.currentHeuristicConfigs.preRollInWallClockSec&&K._heuristicSettings.maximumBufferTimeInSeconds===a.currentHeuristicConfigs.maxBufferInWallClockSec&&K._heuristicSettings.livePlaybackOffsetInSecond===a.currentHeuristicConfigs.livePlaybackOffsetInWallClockSec&&K._traceConfig===this.options_.traceConfig?!1:!0},K.prototype.isLiveStartupError=function(){return this.mediaError===K.errorCodes.MANIFEST_DOWNLOAD_ERROR||this.mediaError===K.errorCodes.TOO_EARLY_TO_JOIN_LIVE_EVENT?!0:!1},y["default"].options.flashSS={},u["default"].registerComponent("FlashSS",K),q["default"].registerTech("FlashSS",K),c["default"]=K,b.exports=c["default"]},{"../ampDefs.js":97,"../video.js/src/js/component.js":163,"../video.js/src/js/player.js":210,"../video.js/src/js/tech/flash.js":218,"../video.js/src/js/tech/tech.js":222,"../video.js/src/js/utils/browser.js":239,"../video.js/src/js/utils/dom.js":242,"../video.js/src/js/utils/fn.js":244,"../video.js/src/js/utils/time-ranges.js":253,"../video.js/src/js/utils/url.js":256,"../video.js/src/js/video.js":257,"global/document":79,"global/window":80,"object.assign":73}],154:[function(a,b,c){"use strict";function d(a){if(a&&a.__esModule)return a;var b={};if(null!=a)for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b[c]=a[c]);return b["default"]=a,b}function e(a){return a&&a.__esModule?a:{"default":a}}function f(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function g(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)}c.__esModule=!0;var h=a("../video.js/src/js/tech/tech.js"),i=e(h),j=a("../video.js/src/js/tech/html5.js"),k=e(j),l=a("../video.js/src/js/component.js"),m=e(l),n=a("../video.js/src/js/utils/fn.js"),o=d(n),p=a("global/window"),q=e(p),r=a("../ampDefs.js"),s=d(r),t=function(a){function b(c,d){f(this,b),a.call(this,c,d)}return g(b,a),b.prototype.dispose=function(){this.fairplay&&this.fairplay.dispose(),a.prototype.dispose.call(this)},b.prototype.eventHandler=function(a){"timeupdate"!==a.type&&"progress"!==a.type&&.Logger.verbose(AMP.Logger.Area.html5FairplayHLS,"Event: "+a.type),"error"===a.type&&this.error()&&i["default"].raiseError.call(this,"html5FairPlayHLS",this.error().code<<20)},b.prototype.setSrc=function(a){AMP.Logger.setLogConfig(this.options_.playerOptions.traceConfig),this.fairplay&&(this.fairplay.dispose(),this.fairplay=null);var c=[];this.options_&&this.options_.playerOptions&&this.options_.playerOptions.sourceOptions&&this.options_.playerOptions.sourceOptions.protectionInfo&&(c=this.options_.playerOptions.sourceOptions.protectionInfo);for(var d=null,e=0;e0;var d=this.mediaPlayer.CreatePlaylist(),e=this.mediaPlayer.CreatePlaylistItem(a,"","","");e.DeliveryMethod="AdaptiveStreaming";var f=this.options_.playerOptions.sourceOptions.protectionInfo;if(f)for(var g=0;g'}),d+=""},G.isSupported=function(){return E.isSilverlightInstalled("5.0")},G.canPlaySource=function(a){return s["default"].canSupportFormats(a,this.supportedFormats)},G.supportedFormats={},G.supportedFormats[D.StreamingFormatMimeType.Smooth]=[D.protectionType.PlayReady],G._srcSet=!1,G._errored=!1,G._seeking=!1,G._ended=!1,G._opening=!0,G._firstTimeUpdateOccuredAfterOpening=!1,G._adaptiveStreamingError=null,G._networkError="Failed to download",G._licenseError="Unable to acquire license due to a network or protocol error",G._tokenError="Unable to complete operation due to a service specific error coming from a network response",G._parseSegmentError="Too many consecutive chunk parse errors",G._parsePresentationError="Manifest file error",G._unsupportedPresentation="Unrecognized manifest",G._licenseAcquisitionErrorCode="6002",G._licenseAcquisitionServiceSpecificErrorCode="6007",G._downloadBitrate,G._playbackBitrate,G.prototype.setTriggers=function(){var a=this;this.mediaPlayer.addEventListener("PlayStateChanged",z.bind(this,this.playStateChangedHandler)),this.mediaPlayer.addEventListener("MediaOpened",z.bind(this,this.onMediaOpened)),this.mediaPlayer.addEventListener("SeekCompleted",z.bind(this,this.onSeekCompleted)),this.mediaPlayer.addEventListener("MediaEnded",z.bind(this,this.onMediaEnded)),this.mediaPlayer.addEventListener("PlaybackPositionChanged",z.bind(this,this.onTimeUpdate)),this.mediaPlayer.addEventListener("VolumeLevelChanged",z.bind(this,this.onVolumeChanged)),this.mediaPlayer.addEventListener("MuteChanged",z.bind(this,this.onVolumeChanged)),this.mediaPlayer.addEventListener("MediaFailed",z.bind(this,this.onMediaFailed)),this.mediaPlayer.addEventListener("AdaptiveStreamingErrorOccurred",z.bind(this,this.onAdaptiveStreamingErrorOccurred)),this.mediaPlayer.addEventListener("ReportDiagTrace",z.bind(this,this.onReportDiagTrace)),this.mediaPlayer.addEventListener("DownloadBitrateChanged",z.bind(this,this.onVideoDownloadBitrateChanged)),this.mediaPlayer.addEventListener("PlaybackBitrateChanged",z.bind(this,this.onVideoPlaybackBitrateChanged)),this.mediaPlayer.addEventListener("FullScreenChanged",z.bind(this,this.onFullScreenChanged));var b=void 0;this.mediaPlayer.addEventListener("PlaybackPositionChanged",z.bind(this,function(){this.duration()!==b&&(b=this.duration(),this.trigger(D.eventName.durationchange)),G._firstTimeUpdateOccuredAfterOpening||G._opening||(this.trigger(D.eventName.play),this.trigger(D.eventName.playing),G._firstTimeUpdateOccuredAfterOpening=!0)})),B.IS_IE&&!function(){var b=z.bind(a,a.onMouseUp);i["default"].addEventListener("mouseup",b,!1),a.on("dispose",function(){i["default"].removeEventListener("mouseup",b)})}()},G.prototype.playStateChangedHandler=function(){switch(this.mediaPlayer.PlayState){case F.Playing:G._firstTimeUpdateOccuredAfterOpening&&(this.trigger(D.eventName.play),this.trigger(D.eventName.playing));break;case F.Paused:this.trigger(D.eventName.pause);break;case F.Buffering:G._firstTimeUpdateOccuredAfterOpening||this.trigger(D.eventName.waiting)}},G.prototype.onMediaOpened=function(){G._opening=!1,this.trigger(D.eventName.durationchange),this.trigger(D.eventName.loadstart),this.trigger(D.eventName.loadedmetadata),this.trigger(D.eventName.loadeddata),this.trigger(D.eventName.canplaythrough)},G.prototype.onMediaFailed=function(a,b){var c=b.Result.Message,d=b.Result.Message;G._adaptiveStreamingError&&(c+=": "+G._adaptiveStreamingError.Message,d=G._adaptiveStreamingError.Message);var e=D.errorCode.errUnknown;-1!==d.indexOf(G._networkError)?e=D.errorCode.networkErrUnknown:-1!==d.indexOf(G._licenseError)||-1!==d.indexOf(G._licenseAcquisitionErrorCode)||-1!==d.indexOf(G._tokenError)||-1!==d.indexOf(G._licenseAcquisitionServiceSpecificErrorCode)?e=D.errorCode.encryptErrLicenseAcquire:-1!==d.indexOf(G._parseSegmentError)?e=D.errorCode.srcErrParseSegment:-1!==d.indexOf(G._parsePresentationError)?e=D.errorCode.srcErrParsePresentation:-1!==d.indexOf(G._unsupportedPresentation)&&(e=D.errorCode.srcErrUnsupportedPresentation),G._errored=!0,o["default"].raiseError.call(this,"silverlightss",e,c)},G.prototype.onAdaptiveStreamingErrorOccurred=function(a,b){G._adaptiveStreamingError=b.Result},G.prototype.onSeekCompleted=function(){G._seeking=!1,this.trigger(D.eventName.seeked)},G.prototype.onMediaEnded=function(){G._ended=!0,this.trigger(D.eventName.ended)},G.prototype.onTimeUpdate=function(){this.trigger(D.eventName.timeupdate)},G.prototype.onFullScreenChanged=function(){this.trigger(D.eventName.fullscreenchange)},G.prototype.onVolumeChanged=function(){this.trigger(D.eventName.volumechange)},G.prototype.onReportDiagTrace=function(a,b){AMP.Logger.verbose(AMP.Logger.Area.silverlightSS,b.Result)},G.prototype.onVideoDownloadBitrateChanged=function(a,b){G._downloadBitrate=b.Result,this.trigger(D.eventName.downloadbitratechanged)},G.prototype.onVideoPlaybackBitrateChanged=function(a,b){G._playbackBitrate=b.Result,this.trigger(D.eventName.playbackbitratechanged)},G.prototype.onMouseUp=function(a){var b=k["default"].elementFromPoint(a.clientX,a.clientY);b===this.el()?this.el().parentNode.focus():this.el().parentNode.blur()},G.prototype.reset=function(){G._srcSet=!1,G._seeking=!1,G._ended=!1,G._opening=!0,G._firstTimeUpdateOccuredAfterOpening=!1,G._adaptiveStreamingError=null,G._errored=!1},u["default"].options.silverlightSS={},q["default"].registerComponent("SilverlightSS",G),o["default"].registerTech("SilverlightSS",G),c["default"]=G,b.exports=c["default"]},{"../ampDefs.js":97,"../video.js/src/js/component.js":163,"../video.js/src/js/player.js":210,"../video.js/src/js/tech/tech.js":222,"../video.js/src/js/utils/browser.js":239,"../video.js/src/js/utils/dom.js":242,"../video.js/src/js/utils/fn.js":244,"../video.js/src/js/utils/time-ranges.js":253,"../video.js/src/js/video.js":257,"./Silverlight.js":151,"global/document":79,"global/window":80,"object.assign":73}],156:[function(a,b,c){"use strict";c.__esModule=!0;var d="2.3.6.3";c.ampVersion=d},{}],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)}c.__esModule=!0;var g=a("./component"),h=d(g),i=a("object.assign"),j=d(i),k=function(a){function b(c,d){e(this,b),a.call(this,c,d)}return f(b,a),b.prototype.createEl=function(){var a=arguments.length<=0||void 0===arguments[0]?"div":arguments[0],b=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],c=arguments.length<=2||void 0===arguments[2]?{}:arguments[2];return b=j["default"]({className:this.buildCSSClass()},b),h["default"].prototype.createEl.call(this,a,b,c)},b.prototype.buildCSSClass=function(){return"vjs-fullscreen-outline "+a.prototype.buildCSSClass.call(this)},b}(h["default"]);h["default"].registerComponent("FullscreenOutline",k),c["default"]=k,b.exports=c["default"]},{"./component":163,"object.assign":73}],158:[function(a,b,c){"use strict";function d(a){if(a&&a.__esModule)return a;var b={};if(null!=a)for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b[c]=a[c]);return b["default"]=a,b}function e(a){return a&&a.__esModule?a:{"default":a}}function f(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function g(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)}c.__esModule=!0;var h=a("./component"),i=e(h),j=a("./utils/dom.js"),k=d(j),l=function(a){function b(c,d){f(this,b),a.call(this,c,d),this.on(c,["removeSpinner","canplaythrough","canplay","playing","pause","seeked","error"],this.updatePlaying),this.on(c,["sourceset","waiting","seeking"],this.updateWaiting),this.on(c,"fullscreenchange",this.handleFullscreenChange),this.on("focus",this.handleFocus)}return g(b,a),b.prototype.createEl=function(){var b=a.prototype.createEl.call(this,"p",{className:"vjs-screen-reader-text",id:"player-use-for-screen-reader-alert-only"+Math.random()});return b.setAttribute("role","alert"),b.setAttribute("aria-atomic","true"),b},b.prototype.updateWaiting=function(){var a=this;setTimeout(function(){null!=a.el_&&(a.el_.innerHTML=a.htmlEncode(a.localize("video loading")))},0)},b.prototype.updatePlaying=function(){var a=this;setTimeout(function(){null!=a.el_&&(a.el_.innerHTML="")},0)},b.prototype.switchFocusToLastControlForSelectorInControlBar=function(a){for(var b=a+" .vjs-control",c=this.player_.controlBar.el().querySelectorAll(b),d=c.length,e=d-1;e>=0;e--){var f=c[e].getAttribute("tabIndex"),g=k.isVisible(c[e]);if(f>=0&&g)return c[e].focus(),!0}return!1},b.prototype.reverseFocus=function(){for(var a=[".amp-controlbaricons-right",".amp-cotnrolbaricons-middle",".amp-controlbaricons-left"],b=0;b=0;a--){this.children_[a].dispose&&this.children_[a].dispose();var b=this.children_[a].name_;b&&this[b]&&delete this[b]}this.children_=null,this.childIndex_=null,this.childNameIndex_=null,this.el_&&this.off(),this.el_&&this.el_.parentNode&&this.el_.parentNode.removeChild(this.el_),this.contentEl_&&this.contentEl_.parentNode&&this.contentEl_.parentNode.removeChild(this.contentEl_),this.el_&&j.removeElData(this.el_),this.contentEl_&&j.removeElData(this.contentEl_),this.el_=null,this.contentEl_=null,this.player_=null,this.options_=null},a.prototype.player=function(){return this.player_},a.prototype.options=function(a){return r["default"].warn("this.options() has been deprecated and will be moved to the constructor in 6.0"),a?(this.options_=v["default"](this.options_,a),this.options_):this.options_},a.prototype.el=function(){return this.el_},a.prototype.createEl=function(a,b,c){return j.createEl(a,b,c)},a.prototype.localize=function(a){var b=this.player_.language&&this.player_.language(),c=this.player_.languages&&this.player_.languages();if(!b||!c)return a;var d=c[b];if(d&&d[a])return d[a];var e=b.split("-")[0],f=c[e];return f&&f[a]?f[a]:a},a.prototype.htmlEncode=function(a){if(!a)return"";for(var b=a.length,c=[],d=0;b>d;d++){var e=a.charAt(d);switch(e){case"<":c.push("<");break;case">":c.push(">");break;case"&":c.push("&");break;case'"':c.push(""");break;case"'":c.push("'");break;default:c.push(e)}}return c.join("")},a.prototype.contentEl=function(){return this.contentEl_||this.el_},a.prototype.id=function(){return this.id_},a.prototype.name=function(){return this.name_},a.prototype.children=function(){return this.children_},a.prototype.getChildById=function(a){return this.childIndex_[a]},a.prototype.getChild=function(a){return this.childNameIndex_[a]},a.prototype.addChild=function(b){var c=this,d=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],e=arguments.length<=2||void 0===arguments[2]?this.children_.length:arguments[2],f=void 0,g=void 0;if("string"==typeof b){g=b,d||(d={}),d===!0&&(r["default"].warn("Initializing a child component with `true` is deprecated. Children should be defined in an array when possible, but if necessary use an object instead of `true`."),d={});var i=d.componentClass||t["default"](g);d.name=g;var j=a.getComponent(i);if(!j)throw new Error("Component "+i+" does not exist");if("function"!=typeof j)return null;f=new j(this.player_||this,d)}else f=b;if(this.children_.splice(e,0,f),"function"==typeof f.id&&(this.childIndex_[f.id()]=f),g=g||f.name&&f.name(),g&&(this.childNameIndex_[g]=f),"function"==typeof f.el&&f.el()){var k;!function(){var a=c.contentEl().children,b=a[e]||null;x.IS_MSAPPHOST&&h["default"].MSApp&&h["default"].MSApp.execUnsafeLocalFunction?(k=c.contentEl(),h["default"].MSApp.execUnsafeLocalFunction(function(){k.insertBefore(f.el(),b)})):c.contentEl().insertBefore(f.el(),b)}()}return f},a.prototype.removeChild=function(a){if("string"==typeof a&&(a=this.getChild(a)),a&&this.children_){for(var b=!1,c=this.children_.length-1;c>=0;c--)if(this.children_[c]===a){b=!0,this.children_.splice(c,1);break}if(b){this.childIndex_[a.id()]=null,this.childNameIndex_[a.name()]=null;var d=a.el();d&&d.parentNode===this.contentEl()&&this.contentEl().removeChild(a.el())}}},a.prototype.initChildren=function(){var b=this,c=this.options_.children;c&&!function(){var d=b.options_,e=function(a){var c=a.name,e=a.opts;if(void 0!==d[c]&&(e=d[c]),e!==!1){e===!0&&(e={}),e.playerOptions=b.options_.playerOptions;var f=b.addChild(c,e);f&&(b[c]=f)}},f=void 0,g=a.getComponent("Tech");f=Array.isArray(c)?c:Object.keys(c),f.concat(Object.keys(b.options_).filter(function(a){return!f.some(function(b){return"string"==typeof b?a===b:a===b.name})})).map(function(a){var d=void 0,e=void 0;return"string"==typeof a?(d=a,e=c[d]||b.options_[d]||{}):(d=a.name,e=a),{name:d,opts:e}}).filter(function(b){var c=a.getComponent(b.opts.componentClass||t["default"](b.name));return c&&!g.isTech(c)}).forEach(e)}()},a.prototype.buildCSSClass=function(){return""},a.prototype.on=function(a,b,c){var d=this;return"string"==typeof a||Array.isArray(a)?p.on(this.el_,a,l.bind(this,b)):!function(){var e=a,f=b,g=l.bind(d,c),h=function(){return d.off(e,f,g); };h.guid=g.guid,d.on("dispose",h);var i=function(){return d.off("dispose",h)};i.guid=g.guid,a.nodeName?(p.on(e,f,g),p.on(e,"dispose",i)):"function"==typeof a.on&&(e.on(f,g),e.on("dispose",i))}(),this},a.prototype.off=function(a,b,c){if(!a||"string"==typeof a||Array.isArray(a))p.off(this.el_,a,b);else{var d=a,e=b,f=l.bind(this,c);this.off("dispose",f),a.nodeName?(p.off(d,e,f),p.off(d,"dispose",f)):(d.off(e,f),d.off("dispose",f))}return this},a.prototype.one=function(a,b,c){var d=this,e=arguments;return"string"==typeof a||Array.isArray(a)?p.one(this.el_,a,l.bind(this,b)):!function(){var f=a,g=b,h=l.bind(d,c),i=function j(){d.off(f,g,j),h.apply(null,e)};i.guid=h.guid,d.on(f,g,i)}(),this},a.prototype.trigger=function(a,b){return p.trigger(this.el_,a,b),this},a.prototype.ready=function(a){var b=arguments.length<=1||void 0===arguments[1]?!1:arguments[1];return a&&(this.isReady_?b?a.call(this):this.setTimeout(a,1):(this.readyQueue_=this.readyQueue_||[],this.readyQueue_.push(a))),this},a.prototype.triggerReady=function(){this.isReady_=!0,this.setTimeout(function(){var a=this.readyQueue_;this.readyQueue_=[],a&&a.length>0&&a.forEach(function(a){a.call(this)},this),this.trigger("ready")},1)},a.prototype.$=function(a,b){return j.$(a,b||this.contentEl())},a.prototype.$$=function(a,b){return j.$$(a,b||this.contentEl())},a.prototype.hasClass=function(a){return j.hasElClass(this.el_,a)},a.prototype.addClass=function(a){return j.addElClass(this.el_,a),this},a.prototype.removeClass=function(a){return j.removeElClass(this.el_,a),this},a.prototype.toggleClass=function(a,b){return j.toggleElClass(this.el_,a,b),this},a.prototype.show=function(){return this.removeClass("vjs-hidden"),this},a.prototype.hide=function(){return this.addClass("vjs-hidden"),this},a.prototype.lockShowing=function(){return this.addClass("vjs-lock-showing"),this},a.prototype.unlockShowing=function(){return this.removeClass("vjs-lock-showing"),this},a.prototype.width=function(a,b){return this.dimension("width",a,b)},a.prototype.height=function(a,b){return this.dimension("height",a,b)},a.prototype.dimensions=function(a,b){return this.width(a,!0).height(b)},a.prototype.dimension=function(a,b,c){if(void 0!==b)return(null===b||b!==b)&&(b=0),this.el_.style[a]=-1!==(""+b).indexOf("%")||-1!==(""+b).indexOf("px")?b:"auto"===b?"":b+"px",c||this.trigger("resize"),this;if(!this.el_)return 0;var d=this.el_.style[a],e=d.indexOf("px");return-1!==e?parseInt(d.slice(0,e),10):parseInt(this.el_["offset"+t["default"](a)],10)},a.prototype.currentDimension=function(a){var b=0;if("width"!==a&&"height"!==a)throw new Error("currentDimension only accepts width or height value");if("function"==typeof h["default"].getComputedStyle){var c=h["default"].getComputedStyle(this.el_);b=c.getPropertyValue(a)||c[a]}else if(this.el_.currentStyle){var d="offset"+t["default"](a);b=this.el_[d]}return b=parseFloat(b)},a.prototype.currentDimensions=function(){return{width:this.currentDimension("width"),height:this.currentDimension("height")}},a.prototype.currentWidth=function(){return this.currentDimension("width")},a.prototype.currentHeight=function(){return this.currentDimension("height")},a.prototype.emitTapEvents=function(){var a=0,b=null,c=10,d=200,e=void 0;this.on("touchstart",function(c){1===c.touches.length&&(b={pageX:c.touches[0].pageX,pageY:c.touches[0].pageY},a=(new Date).getTime(),e=!0)}),this.on("touchmove",function(a){if(a.touches.length>1)e=!1;else if(b){var d=a.touches[0].pageX-b.pageX,f=a.touches[0].pageY-b.pageY,g=Math.sqrt(d*d+f*f);g>c&&(e=!1)}});var f=function(){e=!1};this.on("touchleave",f),this.on("touchcancel",f),this.on("touchend",function(c){if(b=null,e===!0){var f=(new Date).getTime()-a;d>f&&(c.preventDefault(),this.trigger("tap"))}})},a.prototype.enableTouchActivity=function(){if(this.player()&&this.player().reportUserActivity){var a=l.bind(this.player(),this.player().reportUserActivity),b=void 0;this.on("touchstart",function(){a(),this.clearInterval(b),b=this.setInterval(a,250)});var c=function(){a(),this.clearInterval(b)};this.on("touchmove",a),this.on("touchend",c),this.on("touchcancel",c)}},a.prototype.setTimeout=function(a,b){a=l.bind(this,a);var c=h["default"].setTimeout(a,b),d=function(){this.clearTimeout(c)};return d.guid="vjs-timeout-"+c,this.on("dispose",d),c},a.prototype.clearTimeout=function(a){h["default"].clearTimeout(a);var b=function(){};return b.guid="vjs-timeout-"+a,this.off("dispose",b),a},a.prototype.setInterval=function(a,b){a=l.bind(this,a);var c=h["default"].setInterval(a,b),d=function(){this.clearInterval(c)};return d.guid="vjs-interval-"+c,this.on("dispose",d),c},a.prototype.clearInterval=function(a){h["default"].clearInterval(a);var b=function(){};return b.guid="vjs-interval-"+a,this.off("dispose",b),a},a.registerComponent=function(b,c){return a.components_||(a.components_={}),a.components_[b]=c,c},a.getComponent=function(b){return a.components_&&a.components_[b]?a.components_[b]:h["default"]&&h["default"].videojs&&h["default"].videojs[b]?(r["default"].warn("The "+b+" component was added to the videojs object when it should be registered using videojs.registerComponent(name, component)"),h["default"].videojs[b]):void 0},a.extend=function(b){b=b||{},r["default"].warn("Component.extend({}) has been deprecated, use videojs.extend(Component, {}) instead");var c=b.init||b.init||this.prototype.init||this.prototype.init||function(){},d=function(){c.apply(this,arguments)};d.prototype=Object.create(this.prototype),d.prototype.constructor=d,d.extend=a.extend;for(var e in b)b.hasOwnProperty(e)&&(d.prototype[e]=b[e]);return d},a}();y.registerComponent("Component",y),c["default"]=y,b.exports=c["default"]},{"./utils/browser.js":239,"./utils/dom.js":242,"./utils/events.js":243,"./utils/fn.js":244,"./utils/guid.js":247,"./utils/log.js":250,"./utils/merge-options.js":251,"./utils/to-title-case.js":255,"global/window":80}],164:[function(a,b,c){"use strict";function d(a){if(a&&a.__esModule)return a;var b={};if(null!=a)for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b[c]=a[c]);return b["default"]=a,b}function e(a){return a&&a.__esModule?a:{"default":a}}function f(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function g(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)}c.__esModule=!0;var h=a("../track-button.js"),i=e(h),j=a("../../component.js"),k=e(j),l=a("../../utils/fn.js"),m=(d(l),a("./audio-track-menu-item.js")),n=e(m),o=function(a){function b(c){var d=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];f(this,b),d.tracks=c.audioTracks&&c.audioTracks(),a.call(this,c,d),this.el_.setAttribute("aria-label","Audio Menu")}return g(b,a),b.prototype.buildCSSClass=function(){return"vjs-audio-button "+a.prototype.buildCSSClass.call(this)},b.prototype.createItems=function(){var a=arguments.length<=0||void 0===arguments[0]?[]:arguments[0],b=this.player_.audioTracks&&this.player_.audioTracks();if(!b)return a;for(var c=0;c'+this.htmlEncode(this.localize("Stream Type"))+""+this.htmlEncode(this.localize("LIVE"))},{"aria-live":"off"}),b.appendChild(this.contentEl_),b.setAttribute("aria-label",this.htmlEncode(this.localize("LIVE"))),b.setAttribute("style","cursor:pointer"),b.setAttribute("title",this.localize("Go to live")),b},b.prototype.updateShowing=function(){this.player().duration()===1/0?this.show():this.hide()},b.prototype.handleClick=function(){this.clickHandler&&this.clickHandler()},b.prototype.setClickHandler=function(a){this.clickHandler=a},b}(i["default"]);k["default"].registerComponent("LiveDisplay",n),c["default"]=n,b.exports=c["default"]},{"../clickable-component.js":161,"../component.js":163,"../utils/dom.js":242}],169:[function(a,b,c){"use strict";function d(a){if(a&&a.__esModule)return a;var b={};if(null!=a)for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b[c]=a[c]);return b["default"]=a,b}function e(a){return a&&a.__esModule?a:{"default":a}}function f(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function g(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)}c.__esModule=!0;var h=a("../button"),i=e(h),j=a("../component"),k=e(j),l=a("../utils/dom.js"),m=d(l),n=function(a){function b(c,d){f(this,b),a.call(this,c,d),this.on(c,"volumechange",this.update),c.tech_&&c.tech_.featuresVolumeControl===!1&&this.addClass("vjs-hidden"),this.on(c,"loadstart",function(){this.update(),c.tech_.featuresVolumeControl===!1?this.addClass("vjs-hidden"):this.removeClass("vjs-hidden")}),this.on("focus",this.clearOtherMenus)}return g(b,a),b.prototype.buildCSSClass=function(){return"vjs-mute-control "+a.prototype.buildCSSClass.call(this)},b.prototype.handleClick=function(){this.player_.muted(this.player_.muted()?!1:!0)},b.prototype.update=function(){var a=this.player_.volume(),b=3;0===a||this.player_.muted()?b=0:.33>a?b=1:.67>a&&(b=2);var c=this.htmlEncode(this.localize(this.player_.muted()?"Unmute":"Mute"));this.controlText()!==c&&this.controlText(c);for(var d=0;4>d;d++)m.removeElClass(this.el_,"vjs-vol-"+d);m.addElClass(this.el_,"vjs-vol-"+b)},b}(i["default"]);n.prototype.controlText_="Mute",k["default"].registerComponent("MuteToggle",n),c["default"]=n,b.exports=c["default"]},{"../button":160,"../component":163,"../utils/dom.js":242}],170:[function(a,b,c){"use strict";function d(a){if(a&&a.__esModule)return a;var b={};if(null!=a)for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b[c]=a[c]);return b["default"]=a,b}function e(a){return a&&a.__esModule?a:{"default":a}}function f(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function g(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)}c.__esModule=!0;var h=a("global/window"),i=(e(h),a("../button.js")),j=e(i),k=a("../component.js"),l=e(k),m=a("../utils/browser.js"),n=(d(m),function(a){function b(c,d){f(this,b),a.call(this,c,d),this.on(c,"play",this.handlePlay),this.on(c,"pause",this.handlePause),this.on("keydown",this.handleKeyPress),this.on("mouseover",this.clearOtherMenus),this.on("focus",this.clearOtherMenus),this.el_.setAttribute("style","cursor:pointer")}return g(b,a),b.prototype.buildCSSClass=function(){return"vjs-play-control "+a.prototype.buildCSSClass.call(this)},b.prototype.handleClick=function(){this.player_.paused()?this.player_.play():this.player_.pause()},b.prototype.handlePlay=function(){this.removeClass("vjs-paused"),this.addClass("vjs-playing"),this.controlText(this.htmlEncode(this.localize("Pause"))),this.el_.setAttribute("title",this.localize("Pause"))},b.prototype.handlePause=function(){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.controlText(this.htmlEncode(this.localize("Play"))),this.el_.setAttribute("title",this.localize("Play"))},b}(j["default"]));n.prototype.controlText_="Play",l["default"].registerComponent("PlayToggle",n),c["default"]=n,b.exports=c["default"]},{"../button.js":160,"../component.js":163,"../utils/browser.js":239,"global/window":80}],171:[function(a,b,c){"use strict";function d(a){if(a&&a.__esModule)return a;var b={};if(null!=a)for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b[c]=a[c]);return b["default"]=a,b}function e(a){return a&&a.__esModule?a:{"default":a}}function f(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function g(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)}c.__esModule=!0;var h=a("../../menu/menu-button.js"),i=e(h),j=a("../../menu/menu.js"),k=e(j),l=a("./playback-rate-menu-item.js"),m=e(l),n=a("../../component.js"),o=e(n),p=a("../../utils/dom.js"),q=d(p),r=function(a){function b(c,d){f(this,b),a.call(this,c,d),this.updateVisibility(),this.updateLabel(),this.on(c,"loadstart",this.updateVisibility),this.on(c,"ratechange",this.updateLabel)}return g(b,a),b.prototype.createEl=function(){var b=a.prototype.createEl.call(this);return this.labelEl_=q.createEl("div",{className:"vjs-playback-rate-value",innerHTML:1}),b.appendChild(this.labelEl_),b},b.prototype.buildCSSClass=function(){return"vjs-playback-rate "+a.prototype.buildCSSClass.call(this)},b.prototype.createMenu=function(){var a=new k["default"](this.player()),b=this.playbackRates();if(b)for(var c=b.length-1;c>=0;c--)a.addChild(new m["default"](this.player(),{rate:b[c]+"x"}));return a},b.prototype.updateARIAAttributes=function(){this.el().setAttribute("aria-valuenow",this.player().playbackRate())},b.prototype.handleClick=function(){for(var a=this.player().playbackRate(),b=this.playbackRates(),c=b[0],d=0;da){c=b[d];break}this.player().playbackRate(c)},b.prototype.playbackRates=function(){return this.options_.playbackRates||this.options_.playerOptions&&this.options_.playerOptions.playbackRates},b.prototype.playbackRateSupported=function(){return this.player().tech_&&this.player().tech_.featuresPlaybackRate&&this.playbackRates()&&this.playbackRates().length>0},b.prototype.updateVisibility=function(){this.playbackRateSupported()?this.removeClass("vjs-hidden"):this.addClass("vjs-hidden")},b.prototype.updateLabel=function(){this.playbackRateSupported()&&(this.labelEl_.innerHTML=this.htmlEncode(this.player().playbackRate())+"x")},b}(i["default"]);r.prototype.controlText_="Playback Rate",o["default"].registerComponent("PlaybackRateMenuButton",r),c["default"]=r,b.exports=c["default"]},{"../../component.js":163,"../../menu/menu-button.js":206,"../../menu/menu.js":208,"../../utils/dom.js":242,"./playback-rate-menu-item.js":172}],172:[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)}c.__esModule=!0;var g=a("../../menu/menu-item.js"),h=d(g),i=a("../../component.js"),j=d(i),k=function(a){function b(c,d){e(this,b);var f=d.rate,g=parseFloat(f,10);d.label=f,d.selected=1===g,a.call(this,c,d),this.label=f,this.rate=g,this.on(c,"ratechange",this.update)}return f(b,a),b.prototype.handleClick=function(){a.prototype.handleClick.call(this),this.player().playbackRate(this.rate)},b.prototype.update=function(){this.selected(this.player().playbackRate()===this.rate)},b}(h["default"]);k.prototype.contentElType="button",j["default"].registerComponent("PlaybackRateMenuItem",k),c["default"]=k,b.exports=c["default"]},{"../../component.js":163,"../../menu/menu-item.js":207}],173:[function(a,b,c){"use strict";function d(a){if(a&&a.__esModule)return a;var b={};if(null!=a)for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b[c]=a[c]);return b["default"]=a,b}function e(a){return a&&a.__esModule?a:{"default":a}}function f(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function g(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)}c.__esModule=!0;var h=a("../../component.js"),i=e(h),j=a("../../utils/dom.js"),k=d(j),l=function(a){function b(c,d){f(this,b),a.call(this,c,d),this.on(c,"progress",this.update)}return g(b,a),b.prototype.createEl=function(){var b=a.prototype.createEl.call(this,"div",{className:"vjs-load-progress ",innerHTML:''+this.htmlEncode(this.localize("Loaded"))+": 0%"});return b},b.prototype.update=function(){var a=this.player_.buffered(),b=this.player_.duration(),c=this.player_.bufferedEnd(),d=this.el_.children,e=function(a,b){var c=a/b||0;return 100*(c>=1?1:c)+"%"};this.el_.style.width=e(c,b);for(var f=0;fa.length;f--)this.el_.removeChild(d[f-1])},b}(i["default"]);i["default"].registerComponent("LoadProgressBar",l),c["default"]=l,b.exports=c["default"]},{"../../component.js":163,"../../utils/dom.js":242}],174:[function(a,b,c){"use strict";function d(a){if(a&&a.__esModule)return a;var b={};if(null!=a)for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b[c]=a[c]);return b["default"]=a,b}function e(a){return a&&a.__esModule?a:{"default":a}}function f(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function g(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)}c.__esModule=!0;var h=a("global/window"),i=e(h),j=a("../../component.js"),k=e(j),l=a("../../utils/dom.js"),m=d(l),n=a("../../utils/fn.js"),o=d(n),p=a("../../utils/format-time.js"),q=e(p),r=a("lodash-compat/function/throttle"),s=e(r),t=function(a){function b(c,d){var e=this;f(this,b),a.call(this,c,d),d.playerOptions&&d.playerOptions.controlBar&&d.playerOptions.controlBar.progressControl&&d.playerOptions.controlBar.progressControl.keepTooltipsInside&&(this.keepTooltipsInside=d.playerOptions.controlBar.progressControl.keepTooltipsInside),this.keepTooltipsInside&&(this.tooltip=m.createEl("div",{className:"vjs-time-tooltip"}),this.el().appendChild(this.tooltip),this.addClass("vjs-keep-tooltips-inside")),this.tooltipSpan=m.createEl("span",{className:"amp-time-tooltip"}),this.el().appendChild(this.tooltipSpan),this.update(0,0),c.on("ready",function(){e.on(c.controlBar.progressControl.el(),"mousemove",s["default"](o.bind(e,e.handleMouseMove),25))}),this.wallClockTimeDisplaySettings=d.playerOptions.wallClockTimeDisplaySettings,this.showWallClockTime=this.wallClockTimeDisplaySettings?this.wallClockTimeDisplaySettings.enabled:!1}return g(b,a),b.prototype.createEl=function(){return a.prototype.createEl.call(this,"div",{className:"vjs-mouse-display"})},b.prototype.handleMouseMove=function(a){var b=this.player_.duration(),c=this.calculateDistance(a)*b,d=a.pageX-m.findElPosition(this.el().parentNode).left;this.update(c,d)},b.prototype.update=function(a,b){var c=q["default"](a,this.player_.duration());if(this.showWallClockTime){var d=a/this.player_.duration(),e=this.player_.presentationTimeFromPercentageOfDvrWindow(d),f=this.player_.getWallClockTime(e,this.wallClockTimeDisplaySettings.useLocalTimeZone,this.wallClockTimeDisplaySettings.timezone,this.wallClockTimeDisplaySettings.controlBar12HourFormat,!0);c=f||c}if(this.el().style.left=b+"px",this.tooltipSpan.innerHtml=this.tooltipSpan.innerText=c,this.clampAmpTooltipPosition_(b),this.keepTooltipsInside){var g=this.clampPosition_(b),h=b-g+1,j=parseFloat(i["default"].getComputedStyle(this.tooltip).width),k=j/2;this.tooltip.innerHTML=c,this.tooltip.style.right="-"+(k-h)+"px"}},b.prototype.calculateDistance=function(a){return m.getPointerPosition(this.el().parentNode,a).x},b.prototype.clampPosition_=function(a){if(!this.keepTooltipsInside)return a;var b=parseFloat(i["default"].getComputedStyle(this.player().el()).width),c=parseFloat(i["default"].getComputedStyle(this.tooltip).width),d=c/2,e=a;return d>a?e=Math.ceil(d):a>b-d&&(e=Math.floor(b-d)),e},b.prototype.clampAmpTooltipPosition_=function(a){var b=parseFloat(i["default"].getComputedStyle(this.player().el()).width),c=this.tooltipSpan.offsetWidth/2,d=a;d=c>a?Math.ceil(this.tooltipSpan.offsetWidth-a):a>b-c?Math.floor(b-a):c,this.tooltipSpan.style.right=-d+"px"},b}(k["default"]);k["default"].registerComponent("MouseTimeDisplay",t),c["default"]=t,b.exports=c["default"]},{"../../component.js":163,"../../utils/dom.js":242,"../../utils/fn.js":244,"../../utils/format-time.js":246,"global/window":80,"lodash-compat/function/throttle":29}],175:[function(a,b,c){"use strict";function d(a){if(a&&a.__esModule)return a;var b={};if(null!=a)for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b[c]=a[c]);return b["default"]=a,b}function e(a){return a&&a.__esModule?a:{"default":a}}function f(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function g(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)}c.__esModule=!0;var h=a("../../component.js"),i=e(h),j=a("../../utils/fn.js"),k=d(j),l=a("../../utils/dom.js"),m=(d(l),a("../../utils/format-time.js")),n=e(m),o=function(a){function b(c,d){f(this,b),a.call(this,c,d),this.updateDataAttr(),this.on(c,"timeupdate",this.updateDataAttr),c.ready(k.bind(this,this.updateDataAttr)),d.playerOptions&&d.playerOptions.controlBar&&d.playerOptions.controlBar.progressControl&&d.playerOptions.controlBar.progressControl.keepTooltipsInside&&(this.keepTooltipsInside=d.playerOptions.controlBar.progressControl.keepTooltipsInside),this.keepTooltipsInside&&this.addClass("vjs-keep-tooltips-inside")}return g(b,a),b.prototype.createEl=function(){var b=a.prototype.createEl.call(this,"div",{className:"vjs-play-progress vjs-slider-bar ",innerHTML:''+this.htmlEncode(this.localize("Progress"))+": 0%"});return b},b.prototype.updateDataAttr=function(){var a=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();this.el_.setAttribute("data-current-time",n["default"](a,this.player_.duration()))},b}(i["default"]);i["default"].registerComponent("PlayProgressBar",o),c["default"]=o,b.exports=c["default"]},{"../../component.js":163,"../../utils/dom.js":242,"../../utils/fn.js":244,"../../utils/format-time.js":246}],176:[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)}c.__esModule=!0;var g=a("../../component.js"),h=d(g),i=a("./seek-bar.js"),j=(d(i),a("./mouse-time-display.js")),k=(d(j),function(a){function b(){e(this,b),a.apply(this,arguments)}return f(b,a),b.prototype.createEl=function(){return a.prototype.createEl.call(this,"div",{className:"vjs-progress-control vjs-control",tabIndex:-1})},b}(h["default"]));k.prototype.options_={children:["seekBar"]},h["default"].registerComponent("ProgressControl",k),c["default"]=k,b.exports=c["default"]},{"../../component.js":163,"./mouse-time-display.js":174,"./seek-bar.js":177}],177:[function(a,b,c){"use strict";function d(a){if(a&&a.__esModule)return a;var b={};if(null!=a)for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b[c]=a[c]);return b["default"]=a,b} function e(a){return a&&a.__esModule?a:{"default":a}}function f(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function g(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)}c.__esModule=!0;var h=a("global/window"),i=e(h),j=a("../../slider/slider.js"),k=e(j),l=a("../../component.js"),m=e(l),n=a("./load-progress-bar.js"),o=(e(n),a("./play-progress-bar.js")),p=(e(o),a("./tooltip-progress-bar.js")),q=(e(p),a("./seek-handle.js")),r=(e(q),a("../../utils/fn.js")),s=(d(r),a("../../utils/format-time.js")),t=e(s),u=a("object.assign"),v=(e(u),a("../../utils/browser.js")),w=d(v),x=function(a){function b(c,d){f(this,b),a.call(this,c,d),this.timeInterval=8e3,this.isIntervalEnabled=!0,this.timerFunction,this.videoWasPlaying=null,this.on(c,"timeupdate",this.updateProgress),this.on(c,"ended",this.playEnded),this.on(c,"play",this.enableAriaUpdate),this.on(c,"pause",this.handlePause),this.on(c,"seeked",this.handleManualSeeked),this.on(c,"playing",this.handlePlaying),d.playerOptions&&d.playerOptions.controlBar&&d.playerOptions.controlBar.progressControl&&d.playerOptions.controlBar.progressControl.keepTooltipsInside&&(this.keepTooltipsInside=d.playerOptions.controlBar.progressControl.keepTooltipsInside),this.keepTooltipsInside&&(this.tooltipProgressBar=this.addChild("TooltipProgressBar"))}return g(b,a),b.prototype.createEl=function(){return a.prototype.createEl.call(this,"div",{className:"vjs-progress-holder"},{"aria-label":"progress bar"})},b.prototype.playEnded=function(){this.isIntervalEnabled=!1,clearTimeout(this.timerFunction),this.updateProgress()},b.prototype.handleManualSeeked=function(){null!==this.videoWasPlaying&&(this.videoWasPlaying?this.player_.play():this.videoWasPlaying=null)},b.prototype.handlePause=function(){clearTimeout(this.timerFunction),this.isIntervalEnabled=!0},b.prototype.handlePlaying=function(){this.videoWasPlaying=null},b.prototype.enableAriaUpdate=function(){var a=this;this.timerFunction=this.setTimeout(function(){a.isIntervalEnabled=!a.isIntervalEnabled,a.enableAriaUpdate()},this.timeInterval,this)},b.prototype.updateProgress=function(){if(this.updateAriaAttributes(this.el_),this.keepTooltipsInside){this.updateAriaAttributes(this.tooltipProgressBar.el_),this.tooltipProgressBar.el_.style.width=this.bar.el_.style.width;var a=parseFloat(i["default"].getComputedStyle(this.player().el()).width),b=parseFloat(i["default"].getComputedStyle(this.tooltipProgressBar.tooltip).width),c=this.tooltipProgressBar.el().style;c.maxWidth=Math.floor(a-b/2)+"px",c.minWidth=Math.ceil(b/2)+"px",c.right="-"+b/2+"px"}},b.prototype.updateAriaAttributes=function(a){if(this.isIntervalEnabled){var b=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();if(a.setAttribute("aria-valuenow",(100*this.getPercent()).toFixed(2)),0===b)a.setAttribute("aria-valuetext","0");else if(w.IS_SAFARI)a.setAttribute("aria-valuetext",t["default"](b,this.player_.duration()));else{for(var c=t["default"](b,this.player_.duration()),d=c.split(":"),e=0;e=1?1:b},b.prototype.handleMouseDown=function(b){this.player_.scrubbing(!0),null===this.videoWasPlaying&&(this.videoWasPlaying=!this.player_.paused()),this.player_.pause(),a.prototype.handleMouseDown.call(this,b)},b.prototype.handleMouseMove=function(a){var b=this.calculateDistance(a)*this.player_.duration();b===this.player_.duration()&&(b-=.1),this.player_.currentTime(b)},b.prototype.handleMouseUp=function(b){a.prototype.handleMouseUp.call(this,b),this.player_.scrubbing(!1)},b.prototype.stepForward=function(){this.player_.currentTime(this.player_.currentTime()+5)},b.prototype.stepBack=function(){this.player_.currentTime(this.player_.currentTime()-5)},b}(k["default"]);x.prototype.options_={children:["loadProgressBar","mouseTimeDisplay","playProgressBar","seekHandle"],barName:"playProgressBar",handleName:"seekHandle"},x.prototype.playerEvent="timeupdate",m["default"].registerComponent("SeekBar",x),c["default"]=x,b.exports=c["default"]},{"../../component.js":163,"../../slider/slider.js":216,"../../utils/browser.js":239,"../../utils/fn.js":244,"../../utils/format-time.js":246,"./load-progress-bar.js":173,"./play-progress-bar.js":175,"./seek-handle.js":178,"./tooltip-progress-bar.js":179,"global/window":80,"object.assign":73}],178:[function(a,b,c){"use strict";function d(a){if(a&&a.__esModule)return a;var b={};if(null!=a)for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b[c]=a[c]);return b["default"]=a,b}function e(a){return a&&a.__esModule?a:{"default":a}}function f(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function g(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)}c.__esModule=!0;var h=a("../../component.js"),i=e(h),j=a("../../utils/fn.js"),k=d(j),l=a("../../utils/dom.js"),m=(d(l),function(a){function b(c,d){f(this,b),a.call(this,c,d),this.on(c,"timeupdate",this.update),c.ready(k.bind(this,this.update))}return g(b,a),b.prototype.createEl=function(){var b=a.prototype.createEl.call(this,"div",{className:"vjs-slider-handle ",innerHTML:'Seekbar Handle'});return b},b.prototype.update=function(){this.player_.controlBar&&this.player_.controlBar.progressControl&&this.player_.controlBar.progressControl.seekBar&&this.player_.controlBar.progressControl.seekBar.playProgressBar&&(this.el().style.left=this.player_.controlBar.progressControl.seekBar.playProgressBar.el_.style.width)},b}(i["default"]));i["default"].registerComponent("SeekHandle",m),c["default"]=m,b.exports=c["default"]},{"../../component.js":163,"../../utils/dom.js":242,"../../utils/fn.js":244}],179:[function(a,b,c){"use strict";function d(a){if(a&&a.__esModule)return a;var b={};if(null!=a)for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b[c]=a[c]);return b["default"]=a,b}function e(a){return a&&a.__esModule?a:{"default":a}}function f(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function g(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)}c.__esModule=!0;var h=a("../../component.js"),i=e(h),j=a("../../utils/fn.js"),k=d(j),l=a("../../utils/dom.js"),m=(d(l),a("../../utils/format-time.js")),n=e(m),o=function(a){function b(c,d){f(this,b),a.call(this,c,d),this.updateDataAttr(),this.on(c,"timeupdate",this.updateDataAttr),c.ready(k.bind(this,this.updateDataAttr))}return g(b,a),b.prototype.createEl=function(){var b=a.prototype.createEl.call(this,"div",{className:"vjs-tooltip-progress-bar vjs-slider-bar",innerHTML:'
\n '+this.localize("Progress")+": 0%"});return this.tooltip=b.querySelector(".vjs-time-tooltip"),b},b.prototype.updateDataAttr=function(){var a=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime(),b=n["default"](a,this.player_.duration());this.el_.setAttribute("data-current-time",b),this.tooltip.innerHTML=b},b}(i["default"]);i["default"].registerComponent("TooltipProgressBar",o),c["default"]=o,b.exports=c["default"]},{"../../component.js":163,"../../utils/dom.js":242,"../../utils/fn.js":244,"../../utils/format-time.js":246}],180:[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)}c.__esModule=!0;var g=a("./spacer.js"),h=d(g),i=a("../../component.js"),j=d(i),k=function(a){function b(){e(this,b),a.apply(this,arguments)}return f(b,a),b.prototype.buildCSSClass=function(){return"vjs-custom-control-spacer "+a.prototype.buildCSSClass.call(this)},b.prototype.createEl=function(){var b=a.prototype.createEl.call(this,{className:this.buildCSSClass()});return b.innerHTML=" ",b},b}(h["default"]);j["default"].registerComponent("CustomControlSpacer",k),c["default"]=k,b.exports=c["default"]},{"../../component.js":163,"./spacer.js":181}],181:[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)}c.__esModule=!0;var g=a("../../component.js"),h=d(g),i=function(a){function b(){e(this,b),a.apply(this,arguments)}return f(b,a),b.prototype.buildCSSClass=function(){return"vjs-spacer "+a.prototype.buildCSSClass.call(this)},b.prototype.createEl=function(){return a.prototype.createEl.call(this,"div",{className:this.buildCSSClass()})},b}(h["default"]);h["default"].registerComponent("Spacer",i),c["default"]=i,b.exports=c["default"]},{"../../component.js":163}],182:[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)}c.__esModule=!0;var g=a("./text-track-menu-item.js"),h=d(g),i=a("../../component.js"),j=d(i),k=function(a){function b(c,d){e(this,b),d.track={kind:d.kind,player:c,label:"Settings",selectable:!1,"default":!1,mode:"disabled"},d.selectable=!1,a.call(this,c,d),this.addClass("vjs-texttrack-settings"),this.controlText(", opens "+d.kind+" settings dialog")}return f(b,a),b.prototype.handleClick=function(){this.player().getChild("textTrackSettings").show(),this.player().getChild("textTrackSettings").el_.focus()},b}(h["default"]);j["default"].registerComponent("CaptionSettingsMenuItem",k),c["default"]=k,b.exports=c["default"]},{"../../component.js":163,"./text-track-menu-item.js":190}],183:[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)}c.__esModule=!0;var g=a("./text-track-button.js"),h=d(g),i=a("../../component.js"),j=d(i),k=a("./caption-settings-menu-item.js"),l=d(k),m=function(a){function b(c,d,f){e(this,b),a.call(this,c,d,f),this.el_.setAttribute("aria-label","Captions Menu"),this.el_.setAttribute("title",this.localize("Captions Menu")),this.el_.setAttribute("role","region")}return f(b,a),b.prototype.buildCSSClass=function(){return"vjs-captions-button "+a.prototype.buildCSSClass.call(this)},b.prototype.update=function(){var b=2;a.prototype.update.call(this),this.player().tech_&&this.player().tech_.featuresNativeTextTracks&&(b=1),this.items&&this.items.length>b?this.show():this.hide()},b.prototype.createItems=function(){var b=[];return this.player().tech_&&this.player().tech_.featuresNativeTextTracks||b.push(new l["default"](this.player_,{kind:this.kind_})),a.prototype.createItems.call(this,b)},b}(h["default"]);m.prototype.kind_="captions",m.prototype.controlText_="Captions",j["default"].registerComponent("CaptionsButton",m),c["default"]=m,b.exports=c["default"]},{"../../component.js":163,"./caption-settings-menu-item.js":182,"./text-track-button.js":189}],184:[function(a,b,c){"use strict";function d(a){if(a&&a.__esModule)return a;var b={};if(null!=a)for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b[c]=a[c]);return b["default"]=a,b}function e(a){return a&&a.__esModule?a:{"default":a}}function f(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function g(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)}c.__esModule=!0;var h=a("./text-track-button.js"),i=e(h),j=a("../../component.js"),k=e(j),l=a("./text-track-menu-item.js"),m=e(l),n=a("./chapters-track-menu-item.js"),o=e(n),p=a("../../menu/menu.js"),q=e(p),r=a("../../utils/dom.js"),s=d(r),t=a("../../utils/fn.js"),u=(d(t),a("../../utils/to-title-case.js")),v=e(u),w=a("global/window"),x=(e(w),function(a){function b(c,d,e){f(this,b),a.call(this,c,d,e),this.el_.setAttribute("aria-label","Chapters Menu"),this.el_.setAttribute("title",this.localize("Chapters Menu"))}return g(b,a),b.prototype.buildCSSClass=function(){return"vjs-chapters-button "+a.prototype.buildCSSClass.call(this)},b.prototype.createItems=function(){var a=[],b=this.player_.textTracks();if(!b)return a;for(var c=0;c=0;e--){var f=b[e];if(f.kind===this.kind_){c=f;break}}var g=new q["default"](this.player_),h=s.createEl("li",{className:"vjs-menu-title",innerHTML:v["default"](this.kind_),tabIndex:-1});if(g.children_.unshift(h),s.insertElFirst(h,g.contentEl()),c&&null==c.cues){c.mode="hidden";var i=this.player_.remoteTextTrackEls().getTrackElementByTrack_(c);i&&i.addEventListener("load",function(){return a.update()})}if(c&&c.cues&&c.cues.length>0)for(var j=c.cues,k=void 0,e=0,l=j.length;l>e;e++){k=j[e];var m=new o["default"](this.player_,{track:c,cue:k});d.push(m),g.addChild(m)}return d.length>0&&this.show(),this.items=d,g},b}(i["default"]));x.prototype.kind_="chapters",x.prototype.controlText_="Chapters",k["default"].registerComponent("ChaptersButton",x),c["default"]=x,b.exports=c["default"]},{"../../component.js":163,"../../menu/menu.js":208,"../../utils/dom.js":242,"../../utils/fn.js":244,"../../utils/to-title-case.js":255,"./chapters-track-menu-item.js":185,"./text-track-button.js":189,"./text-track-menu-item.js":190,"global/window":80}],185:[function(a,b,c){"use strict";function d(a){if(a&&a.__esModule)return a;var b={};if(null!=a)for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b[c]=a[c]);return b["default"]=a,b}function e(a){return a&&a.__esModule?a:{"default":a}}function f(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function g(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)}c.__esModule=!0;var h=a("../../menu/menu-item.js"),i=e(h),j=a("../../component.js"),k=e(j),l=a("../../utils/fn.js"),m=d(l),n=function(a){function b(c,d){f(this,b);var e=d.track,g=d.cue,h=c.currentTime();d.label=g.text,d.selected=g.startTime<=h&&hc;c++){var e=a[c];if(e.kind!==this.kind_&&"showing"===e.mode){b=!0;break}}b?this.disable():this.enable()},b.prototype.buildCSSClass=function(){return"vjs-descriptions-button "+a.prototype.buildCSSClass.call(this)},b}(i["default"]);n.prototype.kind_="descriptions",n.prototype.controlText_="Descriptions",k["default"].registerComponent("DescriptionsButton",n),c["default"]=n,b.exports=c["default"]},{"../../component.js":163,"../../utils/fn.js":244,"./text-track-button.js":189}],187:[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)}c.__esModule=!0;var g=a("./text-track-menu-item.js"),h=d(g),i=a("../../component.js"),j=d(i),k=a("../../utils/to-title-case.js"),l=d(k),m=function(a){function b(c,d){e(this,b),d.track={kind:d.kind,player:c,label:l["default"](d.kind)+" Off","default":!1,mode:"disabled"},d.selectable=!0,a.call(this,c,d),this.selected(!0)}return f(b,a),b.prototype.handleTracksChange=function(){for(var a=this.player().textTracks(),b=!0,c=0,d=a.length;d>c;c++){var e=a[c];if(e.kind===this.track.kind&&"showing"===e.mode){b=!1;break}}this.selected(b)},b}(h["default"]);j["default"].registerComponent("OffTextTrackMenuItem",m),c["default"]=m,b.exports=c["default"]},{"../../component.js":163,"../../utils/to-title-case.js":255,"./text-track-menu-item.js":190}],188:[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)}c.__esModule=!0;var g=a("./text-track-button.js"),h=d(g),i=a("../../component.js"),j=d(i),k=function(a){function b(c,d,f){e(this,b),a.call(this,c,d,f),this.el_.setAttribute("aria-label","Subtitles Menu"),this.el_.setAttribute("title",this.localize("Subtitles Menu")),this.el_.setAttribute("role","region")}return f(b,a),b.prototype.buildCSSClass=function(){return"vjs-subtitles-button "+a.prototype.buildCSSClass.call(this)},b.prototype.update=function(){a.prototype.update.call(this);var b=1;this.items&&this.items.length>b?this.show():this.hide()},b}(h["default"]);k.prototype.kind_="subtitles",k.prototype.controlText_="Subtitles",j["default"].registerComponent("SubtitlesButton",k),c["default"]=k,b.exports=c["default"]},{"../../component.js":163,"./text-track-button.js":189}],189:[function(a,b,c){"use strict";function d(a){if(a&&a.__esModule)return a;var b={};if(null!=a)for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b[c]=a[c]);return b["default"]=a,b}function e(a){return a&&a.__esModule?a:{"default":a}}function f(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function g(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)}c.__esModule=!0;var h=a("../track-button.js"),i=e(h),j=a("../../component.js"),k=e(j),l=a("../../utils/fn.js"),m=(d(l),a("./text-track-menu-item.js")),n=e(m),o=a("./off-text-track-menu-item.js"),p=e(o),q=function(a){function b(c){var d=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];f(this,b),d.tracks=c.textTracks(),a.call(this,c,d)}return g(b,a),b.prototype.createItems=function(){var a=arguments.length<=0||void 0===arguments[0]?[]:arguments[0];a.push(new p["default"](this.player_,{kind:this.kind_}));var b=this.player_.textTracks();if(!b)return a;for(var c=0;c'+this.htmlEncode(this.localize("Current Time"))+" 0:00"},{"aria-live":"off"}),b.appendChild(this.contentEl_),b},b.prototype.updateContent=function(){var a=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();if(a=m["default"](a,this.player_.duration()),this.showWallClockTime){var b=this.player_.getWallClockTime(null,this.wallClockTimeDisplaySettings.useLocalTimeZone,this.wallClockTimeDisplaySettings.timezone,this.wallClockTimeDisplaySettings.controlBar12HourFormat,!0);a=b||a}var c=this.localize("Current Time");a!==this.time_&&(this.time_=a,this.contentEl_.innerHTML=''+this.htmlEncode(c)+" "+a)},b}(i["default"]);i["default"].registerComponent("CurrentTimeDisplay",n),c["default"]=n,b.exports=c["default"]},{"../../component.js":163,"../../utils/dom.js":242,"../../utils/format-time.js":246}],192:[function(a,b,c){"use strict";function d(a){if(a&&a.__esModule)return a;var b={};if(null!=a)for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b[c]=a[c]);return b["default"]=a,b}function e(a){return a&&a.__esModule?a:{"default":a}}function f(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function g(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)}c.__esModule=!0;var h=a("../../component.js"),i=e(h),j=a("../../utils/dom.js"),k=d(j),l=a("../../utils/format-time.js"),m=e(l),n=function(a){function b(c,d){f(this,b),a.call(this,c,d),this.wallClockTimeDisplaySettings=d.playerOptions.wallClockTimeDisplaySettings,this.showWallClockTime=this.wallClockTimeDisplaySettings?this.wallClockTimeDisplaySettings.enabled:!1,this.showWallClockTime?this.on(c,"timeupdate",this.updateContentWallClockTime):this.on(c,"durationchange",this.updateContent)}return g(b,a),b.prototype.createEl=function(){var b=a.prototype.createEl.call(this,"div",{className:"vjs-duration vjs-time-control vjs-control"});return this.contentEl_=k.createEl("div",{className:"vjs-duration-display",innerHTML:''+this.htmlEncode(this.localize("Duration Time"))+" 0:00"},{"aria-live":"off"}),b.appendChild(this.contentEl_),b},b.prototype.updateContent=function(){var a=this.player_.duration();if(a&&this.duration_!==a){this.duration_=a;var b=this.localize("Duration Time"),c=m["default"](a);this.contentEl_.innerHTML=''+this.htmlEncode(b)+" "+c}},b.prototype.updateContentWallClockTime=function(){var a=null,b=this.player_.playableWindowEndInSec()||this.player_.duration();if(a=this.player_.getWallClockTime(b,this.wallClockTimeDisplaySettings.useLocalTimeZone,this.wallClockTimeDisplaySettings.timezone,this.wallClockTimeDisplaySettings.controlBar12HourFormat,!0)){if(this.duration_!==a){this.duration_=a;var c=this.localize("End Time");this.contentEl_.innerHTML=''+this.htmlEncode(c)+" "+a}}else this.updateContent()},b}(i["default"]);i["default"].registerComponent("DurationDisplay",n),c["default"]=n,b.exports=c["default"]},{"../../component.js":163,"../../utils/dom.js":242,"../../utils/format-time.js":246}],193:[function(a,b,c){"use strict";function d(a){if(a&&a.__esModule)return a;var b={};if(null!=a)for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b[c]=a[c]);return b["default"]=a,b}function e(a){return a&&a.__esModule?a:{"default":a}}function f(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function g(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)}c.__esModule=!0;var h=a("../../component.js"),i=e(h),j=a("../../utils/dom.js"),k=d(j),l=a("../../utils/format-time.js"),m=e(l),n=function(a){function b(c,d){f(this,b),a.call(this,c,d),this.on(c,"timeupdate",this.updateContent),this.on(c,"durationchange",this.updateContent)}return g(b,a),b.prototype.createEl=function(){var b=a.prototype.createEl.call(this,"div",{className:"vjs-remaining-time vjs-time-control vjs-control"});return this.contentEl_=k.createEl("div",{className:"vjs-remaining-time-display",innerHTML:''+this.htmlEncode(this.localize("Remaining Time"))+" -0:00"},{"aria-live":"off"}),b.appendChild(this.contentEl_),b},b.prototype.updateContent=function(){if(this.player_.duration()){var a=this.localize("Remaining Time"),b=m["default"](this.player_.remainingTime());b!==this.formattedTime_&&(this.formattedTime_=b,this.contentEl_.innerHTML=''+this.htmlEncode(a)+" -"+b)}},b}(i["default"]);i["default"].registerComponent("RemainingTimeDisplay",n),c["default"]=n,b.exports=c["default"]},{"../../component.js":163,"../../utils/dom.js":242,"../../utils/format-time.js":246}],194:[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); }c.__esModule=!0;var g=a("../../component.js"),h=d(g),i=function(a){function b(){e(this,b),a.apply(this,arguments)}return f(b,a),b.prototype.createEl=function(){return a.prototype.createEl.call(this,"div",{className:"vjs-time-control vjs-time-divider",innerHTML:"
/
"})},b.prototype.blank=function(){this.el().innerHTML="
"},b.prototype.unblank=function(){this.el().innerHTML="
/
"},b}(h["default"]);h["default"].registerComponent("TimeDivider",i),c["default"]=i,b.exports=c["default"]},{"../../component.js":163}],195:[function(a,b,c){"use strict";function d(a){if(a&&a.__esModule)return a;var b={};if(null!=a)for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b[c]=a[c]);return b["default"]=a,b}function e(a){return a&&a.__esModule?a:{"default":a}}function f(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function g(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)}c.__esModule=!0;var h=a("../menu/menu-button.js"),i=e(h),j=a("../component.js"),k=e(j),l=a("../utils/fn.js"),m=d(l),n=function(a){function b(c,d){f(this,b);var e=d.tracks;if(a.call(this,c,d),this.items.length<=1&&this.hide(),e){var g=m.bind(this,this.update);e.addEventListener("removetrack",g),e.addEventListener("addtrack",g),this.player_.on("dispose",function(){e.removeEventListener("removetrack",g),e.removeEventListener("addtrack",g)})}}return g(b,a),b}(i["default"]);k["default"].registerComponent("TrackButton",n),c["default"]=n,b.exports=c["default"]},{"../component.js":163,"../menu/menu-button.js":206,"../utils/fn.js":244}],196:[function(a,b,c){"use strict";function d(a){if(a&&a.__esModule)return a;var b={};if(null!=a)for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b[c]=a[c]);return b["default"]=a,b}function e(a){return a&&a.__esModule?a:{"default":a}}function f(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function g(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)}c.__esModule=!0;var h=a("../../slider/slider.js"),i=e(h),j=a("../../component.js"),k=e(j),l=a("../../utils/fn.js"),m=d(l),n=a("./volume-level.js"),o=(e(n),function(a){function b(c,d){f(this,b),a.call(this,c,d),this.on(c,"volumechange",this.updateARIAAttributes),c.ready(m.bind(this,this.updateARIAAttributes))}return g(b,a),b.prototype.createEl=function(){var b=a.prototype.createEl.call(this,"div",{className:"vjs-volume-bar vjs-slider-bar "},{"aria-label":"volume level"});return b},b.prototype.handleMouseMove=function(a){this.checkMuted(),this.player_.volume(this.calculateDistance(a))},b.prototype.checkMuted=function(){this.player_.muted()&&this.player_.muted(!1)},b.prototype.getPercent=function(){return this.player_.muted()?0:this.player_.volume()},b.prototype.stepForward=function(){this.checkMuted(),this.player_.volume(this.player_.volume()+.1)},b.prototype.stepBack=function(){this.checkMuted(),this.player_.volume(this.player_.volume()-.1)},b.prototype.updateARIAAttributes=function(){var a=(100*this.player_.volume()).toFixed(2);this.el_.setAttribute("aria-valuenow",a),this.el_.setAttribute("aria-valuetext",a+"%")},b}(i["default"]));o.prototype.options_={children:["volumeLevel"],barName:"volumeLevel"},o.prototype.playerEvent="volumechange",k["default"].registerComponent("VolumeBar",o),c["default"]=o,b.exports=c["default"]},{"../../component.js":163,"../../slider/slider.js":216,"../../utils/fn.js":244,"./volume-level.js":198}],197:[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)}c.__esModule=!0;var g=a("../../component.js"),h=d(g),i=a("./volume-bar.js"),j=(d(i),function(a){function b(c,d){e(this,b),a.call(this,c,d),c.tech_&&c.tech_.featuresVolumeControl===!1&&this.addClass("vjs-hidden"),this.on(c,"loadstart",function(){c.tech_.featuresVolumeControl===!1?this.addClass("vjs-hidden"):this.removeClass("vjs-hidden")})}return f(b,a),b.prototype.createEl=function(){return a.prototype.createEl.call(this,"div",{className:"vjs-volume-control vjs-control"})},b}(h["default"]));j.prototype.options_={children:["volumeBar"]},h["default"].registerComponent("VolumeControl",j),c["default"]=j,b.exports=c["default"]},{"../../component.js":163,"./volume-bar.js":196}],198:[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)}c.__esModule=!0;var g=a("../../component.js"),h=d(g),i=function(a){function b(){e(this,b),a.apply(this,arguments)}return f(b,a),b.prototype.createEl=function(){return a.prototype.createEl.call(this,"div",{className:"vjs-volume-level",innerHTML:''})},b}(h["default"]);h["default"].registerComponent("VolumeLevel",i),c["default"]=i,b.exports=c["default"]},{"../../component.js":163}],199:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a){if(a&&a.__esModule)return a;var b={};if(null!=a)for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b[c]=a[c]);return b["default"]=a,b}function f(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function g(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)}c.__esModule=!0;var h=a("../utils/fn.js"),i=e(h),j=a("../component.js"),k=d(j),l=a("../popup/popup.js"),m=d(l),n=a("../popup/popup-button.js"),o=d(n),p=a("./mute-toggle.js"),q=d(p),r=a("./volume-control/volume-bar.js"),s=d(r),t=function(a){function b(c){function d(){c.tech_&&c.tech_.featuresVolumeControl===!1?this.addClass("vjs-hidden"):this.removeClass("vjs-hidden")}var e=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];f(this,b),void 0===e.inline&&(e.inline=!0),void 0===e.vertical&&(e.vertical=e.inline?!1:!0),e.volumeBar=e.volumeBar||{},e.volumeBar.vertical=!!e.vertical,a.call(this,c,e),this.on(c,"volumechange",this.volumeUpdate),this.on(c,"loadstart",this.volumeUpdate),d.call(this),this.on(c,"loadstart",d)}return g(b,a),b.prototype.buildCSSClass=function(){var b="";return b=this.options_.vertical?"vjs-volume-menu-button-vertical":"vjs-volume-menu-button-horizontal","vjs-volume-menu-button "+a.prototype.buildCSSClass.call(this)+" "+b},b.prototype.createPopup=function(){var a=new m["default"](this.player_,{contentElType:"div"}),b=new s["default"](this.player_,this.options_.volumeBar);return a.addChild(b),this.menuContent=a,this.volumeBar=b,this.attachVolumeBarEvents(),a},b.prototype.handleClick=function(){q["default"].prototype.handleClick.call(this),this.buttonPressed_=!this.buttonPressed_,a.prototype.handleClick.call(this)},b.prototype.attachVolumeBarEvents=function(){this.menuContent.on(["mousedown","touchdown"],i.bind(this,this.handleMouseDown))},b.prototype.handleMouseDown=function(){this.on(["mousemove","touchmove"],i.bind(this.volumeBar,this.volumeBar.handleMouseMove)),this.on(this.el_.ownerDocument,["mouseup","touchend"],this.handleMouseUp)},b.prototype.handleMouseUp=function(){this.off(["mousemove","touchmove"],i.bind(this.volumeBar,this.volumeBar.handleMouseMove))},b}(o["default"]);t.prototype.volumeUpdate=q["default"].prototype.update,t.prototype.controlText_="Volume",t.prototype.buttonPressed_=!1,t.prototype.unpressButton=function(){this.menuContent.unlockShowing(),this.el_.setAttribute("aria-expanded","false"),this.buttonPressed_=!1},k["default"].registerComponent("VolumeMenuButton",t),c["default"]=t,b.exports=c["default"]},{"../component.js":163,"../popup/popup-button.js":212,"../popup/popup.js":213,"../utils/fn.js":244,"./mute-toggle.js":169,"./volume-control/volume-bar.js":196}],200:[function(a,b,c){"use strict";function d(a){if(a&&a.__esModule)return a;var b={};if(null!=a)for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b[c]=a[c]);return b["default"]=a,b}function e(a){return a&&a.__esModule?a:{"default":a}}function f(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function g(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)}c.__esModule=!0;var h=a("./component"),i=e(h),j=a("./modal-dialog"),k=e(j),l=a("./utils/dom"),m=d(l),n=a("./utils/merge-options"),o=e(n),p=function(a){function b(c,d){f(this,b),a.call(this,c,d),this.contentEl_.setAttribute("tabIndex",0),this.on(c,"error",this.open)}return g(b,a),b.prototype.buildCSSClass=function(){return"vjs-error-display "+a.prototype.buildCSSClass.call(this)},b.prototype.content=function(){var a=this.player().error();return a?this.localize(a.message):""},b.prototype.open=function(){a.prototype.open.call(this),this.opened_&&(m.textContent(this.descEl_,this.content()),this.player_.controlBar&&this.player_.controlBar.hide())},b.prototype.close=function(){this.hasBeenOpened_===!0&&this.player_.controlBar&&this.player_.controlBar.show(),a.prototype.close.call(this)},b}(k["default"]);p.prototype.options_=o["default"](k["default"].prototype.options_,{fillAlways:!0,temporary:!1,uncloseable:!0}),i["default"].registerComponent("ErrorDisplay",p),c["default"]=p,b.exports=c["default"]},{"./component":163,"./modal-dialog":209,"./utils/dom":242,"./utils/merge-options":251}],201:[function(a,b,c){"use strict";function d(a){if(a&&a.__esModule)return a;var b={};if(null!=a)for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b[c]=a[c]);return b["default"]=a,b}c.__esModule=!0;var e=a("./utils/events.js"),f=d(e),g=function(){};g.prototype.allowedEvents_={},g.prototype.on=function(a,b){var c=this.addEventListener;this.addEventListener=function(){},f.on(this,a,b),this.addEventListener=c},g.prototype.addEventListener=g.prototype.on,g.prototype.off=function(a,b){f.off(this,a,b)},g.prototype.removeEventListener=g.prototype.off,g.prototype.one=function(a,b){var c=this.addEventListener;this.addEventListener=function(){},f.one(this,a,b),this.addEventListener=c},g.prototype.trigger=function(a){var b=a.type||a;"string"==typeof a&&(a={type:b}),a=f.fixEvent(a),this.allowedEvents_[b]&&this["on"+b]&&this["on"+b](a),f.trigger(this,a)},g.prototype.dispatchEvent=g.prototype.trigger,c["default"]=g,b.exports=c["default"]},{"./utils/events.js":243}],202:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}c.__esModule=!0;var e=a("./utils/log"),f=d(e),g=function(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&&(a.super_=b)},h=function(a){var b=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],c=function(){a.apply(this,arguments)},d={};"object"==typeof b?("function"==typeof b.init&&(f["default"].warn("Constructor logic via init() is deprecated; please use constructor() instead."),b.constructor=b.init),b.constructor!==Object.prototype.constructor&&(c=b.constructor),d=b):"function"==typeof b&&(c=b),g(c,a);for(var e in d)d.hasOwnProperty(e)&&(c.prototype[e]=d[e]);return c};c["default"]=h,b.exports=c["default"]},{"./utils/log":250}],203:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}c.__esModule=!0;for(var e=a("global/document"),f=d(e),g={},h=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror"],["webkitRequestFullScreen","webkitCancelFullScreen","webkitCurrentFullScreenElement","webkitCancelFullScreen","webkitfullscreenchange","webkitfullscreenerror"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError"]],i=h[0],j=void 0,k=0;k1&&this.show()},b.prototype.createMenu=function(){var a=new m["default"](this.player_);if(this.options_.title){var b=o.createEl("li",{className:"vjs-menu-title",innerHTML:this.htmlEncode(s["default"](this.options_.title)),tabIndex:-1});a.children_.unshift(b),o.insertElFirst(b,a.contentEl())}if(this.items=this.createItems(),this.items)for(var c=0;c=0&&this.el_.focus()}},b.prototype.disable=function(){return this.buttonPressed_=!1,this.menu.unlockShowing(),this.el_.setAttribute("aria-expanded","false"),this.enabled_=!1,a.prototype.disable.call(this)},b.prototype.enable=function(){return this.enabled_=!0,a.prototype.enable.call(this)},b.prototype.clearOtherMenus=function(){x["default"](this),this.clearKeyboardTooltip()},b}(i["default"]);k["default"].registerComponent("MenuButton",y),c["default"]=y,b.exports=c["default"]},{"../component.js":163,"../tooltip-clickable.js":223,"../utils/browser.js":239,"../utils/close-other-menu.js":241,"../utils/dom.js":242,"../utils/fn.js":244,"../utils/to-title-case.js":255,"./menu.js":208,"global/window":80}],207:[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)}c.__esModule=!0;var g=a("../clickable-component.js"),h=d(g),i=a("../component.js"),j=d(i),k=a("object.assign"),l=d(k),m=function(a){function b(c,d){e(this,b),a.call(this,c,d),this.selectable=d.selectable,this.selected(d.selected),this.selectable?this.el_.setAttribute("role","menuitemcheckbox"):this.el_.setAttribute("role","menuitem")}return f(b,a),b.prototype.createEl=function(b,c,d){return a.prototype.createEl.call(this,"li",l["default"]({className:"vjs-menu-item",innerHTML:this.htmlEncode(this.localize(this.options_.label)),tabIndex:-1},c),d=l["default"]({"aria-label":this.htmlEncode(this.localize(this.options_.label))},d))},b.prototype.handleClick=function(){this.selected(!0)},b.prototype.selected=function(a){this.selectable&&(a?(this.addClass("vjs-selected"),this.el_.setAttribute("aria-checked","true"),this.controlText(", selected")):(this.removeClass("vjs-selected"),this.el_.setAttribute("aria-checked","false"),this.controlText(" ")))},b}(h["default"]);j["default"].registerComponent("MenuItem",m),c["default"]=m,b.exports=c["default"]},{"../clickable-component.js":161,"../component.js":163,"object.assign":73}],208:[function(a,b,c){"use strict";function d(a){if(a&&a.__esModule)return a;var b={};if(null!=a)for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b[c]=a[c]);return b["default"]=a,b}function e(a){return a&&a.__esModule?a:{"default":a}}function f(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function g(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)}c.__esModule=!0;var h=a("../component.js"),i=e(h),j=a("../utils/dom.js"),k=d(j),l=a("../utils/fn.js"),m=d(l),n=a("../utils/events.js"),o=d(n),p=function(a){function b(c,d){f(this,b),a.call(this,c,d),this.focusedChild_=-1,this.on("keydown",this.handleKeyPress)}return g(b,a),b.prototype.addItem=function(a){this.addChild(a),a.on("click",m.bind(this,function(){this.unlockShowing()}))},b.prototype.createEl=function(){var b=this.options_.contentElType||"ul";this.contentEl_=k.createEl(b,{className:"vjs-menu-content"}),this.contentEl_.setAttribute("role","menu");var c=a.prototype.createEl.call(this,"div",{append:this.contentEl_,className:"vjs-menu"});return c.setAttribute("role","presentation"),c.appendChild(this.contentEl_),o.on(c,"click",function(a){a.preventDefault(),a.stopImmediatePropagation()}),c},b.prototype.handleKeyPress=function(a){37===a.which||40===a.which?(a.preventDefault(),this.stepForward()):(38===a.which||39===a.which)&&(a.preventDefault(),this.stepBack())},b.prototype.stepForward=function(){var a=0;void 0!==this.focusedChild_&&(a=this.focusedChild_+1),this.focus(a,!0)},b.prototype.stepBack=function(){var a=0;void 0!==this.focusedChild_&&(a=this.focusedChild_-1),this.focus(a,!1)},b.prototype.focus=function(){var a=arguments.length<=0||void 0===arguments[0]?0:arguments[0],b=arguments.length<=1||void 0===arguments[1]?!0:arguments[1],c=this.children().slice(),d=c.length&&c[0].className&&/vjs-menu-title/.test(c[0].className);d&&c.shift(),c.length>0&&(0>a?a=0:a>=c.length&&(a=c.length-1),a=this.getNextVisibleElement(a,c,b),-1!==a&&(this.focusedChild_=a,c[a].el_.focus()))},b.prototype.getNextVisibleElement=function(a,b,c){for(;a>=0&&a=0&&(c.width=a),b>=0&&(c.height=b)))}var d=20,e=s.bind(this,function(){var a=void 0,b=void 0,c=void 0,f=void 0;void 0!==this.aspectRatio_&&"auto"!==this.aspectRatio_?c=this.aspectRatio_:this.videoWidth()?(c=this.videoWidth()+":"+this.videoHeight(),1080===this.videoHeight()&&1920===this.videoWidth()&&d--&&this.setTimeout(e,100)):(c="16:9",d--&&this.setTimeout(e,100));var g=c.split(":"),h=g[1]/g[0];a=void 0!==this.width_?this.dimension("width"):void 0!==this.height_?this.height_/h:this.videoWidth()||300,b=void 0!==this.height_?this.dimension("height"):a*h;var i=q.getElAttributes(this.multiPlayerContainerDiv);f=/^[^a-zA-Z]/.test(i.id)?"dimensions-"+i.id:i.id+"-dimensions",null!==this.mainPlayer&&this.mainPlayer.sizeCal||(q.addElClass(this.multiPlayerContainerDiv,f),G.setTextContent(this.styleEl_,"\n ."+f+" {\n width: "+a+"px;\n height: "+b+"px;\n }\n\n ."+f+".vjs-fluid {\n padding-top: "+100*h+"%;\n }\n "),this.sizeCal=!0)});e()},b.prototype.loadTech_=function(a,b){var c=this;this.tech_&&this.unloadTech_(),"Html5"!==a&&"Html5FairPlayHLS"!==a&&this.tag&&(ma["default"].getTech("Html5").disposeMediaElement(this.tag),this.tag.player=null,this.tag=null),this.techName_=a,this.isReady_=!1;var d=this.id()+"_"+a+"_api_"+parseInt(1e4*Math.random()),e=O["default"]({nativeControlsForTouch:this.options_.nativeControlsForTouch,source:b,playerId:this.id(),techId:d,videoTracks:this.videoTracks_,textTracks:this.textTracks_,audioTracks:this.audioTracks_,autoplay:this.options_.autoplay,preload:this.options_.preload,loop:this.options_.loop,muted:this.options_.muted,poster:this.poster(),language:this.language(),"vtt.js":this.options_["vtt.js"],staleDataTimeLimitInSec:this.options_.staleDataTimeLimitInSec},this.options_[A["default"](a)]);e.playerOptions=O["default"]({},this.options_),this.tag&&(e.tag=this.tag),e.originalTagAttributes=this.tagAttributes,b&&(this.currentType_=b.type,b.src===this.cache_.src&&this.cache_.currentTime>0&&(e.startTime=this.cache_.currentTime),this.cache_.src=b.src);var f=ma["default"].getTech(a);f||(f=i["default"].getComponent(a)),this.tech_=new f(e),this.tech_.ready(s.bind(this,this.handleTechReady_),!0),S["default"].jsonToTextTracks(this.textTracksJson_||[],this.tech_),this.on(this.tech_,"loadstart",this.handleTechLoadStart_),this.on(this.tech_,"waiting",this.handleTechWaiting_),this.on(this.tech_,"canplay",this.handleTechCanPlay_),this.on(this.tech_,"canplaythrough",this.handleTechCanPlayThrough_),this.on(this.tech_,"playing",this.handleTechPlaying_),this.on(this.tech_,"ended",this.handleTechEnded_),this.on(this.tech_,"seeking",this.handleTechSeeking_),this.on(this.tech_,"seeked",this.handleTechSeeked_),this.on(this.tech_,"play",this.handleTechPlay_),this.on(this.tech_,"firstplay",this.handleTechFirstPlay_),this.on(this.tech_,"pause",this.handleTechPause_),this.on(this.tech_,"progress",this.handleTechProgress_),this.on(this.tech_,"durationchange",this.handleTechDurationChange_),this.on(this.tech_,"fullscreenchange",this.handleTechFullscreenChange_),this.on(this.tech_,"error",this.handleTechError_),this.on(this.tech_,"suspend",this.handleTechSuspend_),this.on(this.tech_,"abort",this.handleTechAbort_),this.on(this.tech_,"emptied",this.handleTechEmptied_),this.on(this.tech_,"stalled",this.handleTechStalled_),this.on(this.tech_,"loadedmetadata",this.handleTechLoadedMetaData_),this.on(this.tech_,"loadeddata",this.handleTechLoadedData_),this.on(this.tech_,"timeupdate",this.handleTechTimeUpdate_),this.on(this.tech_,"ratechange",this.handleTechRateChange_),this.on(this.tech_,"volumechange",this.handleTechVolumeChange_),this.on(this.tech_,"texttrackchange",this.handleTechTextTrackChange_),this.on(this.tech_,"loadedmetadata",this.updateStyleEl_),this.on(this.tech_,"posterchange",this.handleTechPosterChange_),this.on(this.tech_,"textdata",this.handleTechTextData_),this.on(this.tech_,"sourceset",this.handleTechSourceSet_),this.on(this.tech_,"downloadbitratechanged",this.handleTechDownloadBitrateChanged_),this.on(this.tech_,"playbackbitratechanged",this.handleTechPlaybackBitrateChanged_),this.on(this.tech_,"splicewaiting",this.handleTechSpliceWaiting_),this.on(this.tech_,"emsgAvailable",this.handleTechEmsgAvailable_),this.on(this.tech_,"saveMemoryLog",function(){c.trigger("saveMemoryLog")}),this.on(this.tech_,"drmselected",function(){c.trigger("drmselected")});var g=["aesKeyFetchCompleted","manifestFetchCompleted","initialBandwidthEstimationCompleted","mediaSourceSrcSetResolved","javascriptBridgeCreated"];g.forEach(function(a){var b=this;this.on(this.tech_,a,function(){b.trigger(a)})},this),this.on(this.tech_,"decryptorInitialized",function(a){c.trigger("decryptorInitialized",{type:a.message})}),this.on(this.tech_,"decryptionFailed",function(a){c.trigger("decryptionFailed",{url:a.message})}),this.usingNativeControls(this.techGet_("controls")),(this.controls()&&!this.usingNativeControls()||!this.controls()&&this.adClickEnabled_)&&this.addTechControlsListeners_(),this.tech_.el().parentNode===this.el()||"Html5"===a&&this.tag||q.insertElFirst(this.tech_.el(),this.el()),this.tag&&(this.tag.player=null,this.tag=null)},b.prototype.unloadTech_=function(){this.videoTracks_=this.videoTracks(),this.textTracks_=this.textTracks(),this.audioTracks_=this.audioTracks(),this.textTracksJson_=S["default"].textTracksToJson(this.tech_),this.isReady_=!1,this.tech_.dispose(),this.tech_=!1},b.prototype.tech=function(a){if(a&&a.IWillNotUseThisInPlugins)return this.tech_;var b="\n Please make sure that you are not using this inside of a plugin.\n To disable this alert and error, please pass in an object with\n `IWillNotUseThisInPlugins` to the `tech` method. See\n https://github.com/videojs/video.js/issues/2617 for more info.\n ";throw m["default"].alert(b),new Error(b)},b.prototype.addTechControlsListeners_=function(){this.tech_&&(this.removeTechControlsListeners_(),this.on(this.tech_,"mousedown",this.handleTechClick_),this.on(this.tech_,"touchstart",this.handleTechTouchStart_),this.on(this.tech_,"touchmove",this.handleTechTouchMove_),this.on(this.tech_,"touchend",this.handleTechTouchEnd_),this.on(this.tech_,"tap",this.handleTechTap_))},b.prototype.removeTechControlsListeners_=function(){this.tech_&&(this.off(this.tech_,"tap",this.handleTechTap_),this.off(this.tech_,"touchstart",this.handleTechTouchStart_),this.off(this.tech_,"touchmove",this.handleTechTouchMove_),this.off(this.tech_,"touchend",this.handleTechTouchEnd_),this.off(this.tech_,"mousedown",this.handleTechClick_))},b.prototype.handleTechSourceSet_=function(){this.trigger("sourceset")},b.prototype.handleTechDownloadBitrateChanged_=function(){this.trigger("downloadbitratechanged")},b.prototype.handleTechPlaybackBitrateChanged_=function(){this.trigger("playbackbitratechanged")},b.prototype.handleTechSpliceWaiting_=function(){this.trigger("splicewaiting")},b.prototype.handleTechEmsgAvailable_=function(a){this.trigger("emsgAvailable",{data:a.data})},b.prototype.handleTechReady_=function(){if(this.triggerReady(),this.cache_.volume&&this.techCall_("setVolume",this.cache_.volume),this.handleTechPosterChange_(),this.handleTechDurationChange_(),(this.src()||this.currentSrc())&&this.tag&&this.options_.autoplay&&this.paused()){try{delete this.tag.poster}catch(a){y["default"]("deleting tag.poster throws in some browsers",a)}this.play()}},b.prototype.handleTechLoadStart_=function(){this.removeClass("vjs-ended"),this.error(null),this.paused()?(this.hasStarted(!1),this.trigger("loadstart")):(this.trigger("loadstart"),this.trigger("firstplay"))},b.prototype.hasStarted=function(a){return void 0!==a?(this.hasStarted_!==a&&(this.hasStarted_=a,a?(this.addClass("vjs-has-started"),this.trigger("firstplay")):this.removeClass("vjs-has-started")),this):!!this.hasStarted_},b.prototype.handleTechPlay_=function(){this.removeClass("vjs-ended"),this.removeClass("vjs-paused"),this.addClass("vjs-playing"),this.removeClass("vjs-waiting"),this.hasStarted(!0),this.trigger("play")},b.prototype.handleTechWaiting_=function(){var a=this;this.addClass("vjs-waiting"),this.trigger("waiting"),this.one("timeupdate",function(){return a.removeClass("vjs-waiting")})},b.prototype.handleTechCanPlay_=function(){this.removeClass("vjs-waiting"),this.trigger("canplay")},b.prototype.handleTechCanPlayThrough_=function(){this.removeClass("vjs-waiting"),this.trigger("canplaythrough")},b.prototype.handleTechPlaying_=function(){this.removeClass("vjs-waiting"),this.trigger("playing")},b.prototype.handleTechSeeking_=function(){this.addClass("vjs-seeking"),this.trigger("seeking")},b.prototype.handleTechSeeked_=function(){this.removeClass("vjs-seeking"),this.removeClass("vjs-waiting"),this.trigger("seeked")},b.prototype.handleTechFirstPlay_=function(){this.options_.starttime&&this.currentTime(this.options_.starttime),this.addClass("vjs-has-started"),this.trigger("firstplay")},b.prototype.handleTechPause_=function(){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.trigger("pause")},b.prototype.handleTechProgress_=function(){this.trigger("progress")},b.prototype.handleTechEnded_=function(){this.addClass("vjs-ended"),this.options_.loop?(this.currentTime(0),this.play()):this.paused()||this.pause(),this.trigger("ended")},b.prototype.handleTechDurationChange_=function(){this.duration(Math.round(this.techGet_("duration")));var a=function(a,b){null!=a&&(b?a.show():a.hide())},b=isFinite(this.duration());null!=this.controlBar&&(a(this.controlBar.progressControl,b),a(this.controlBar.currentTimeDisplay,b),a(this.controlBar.durationDisplay,b),a(this.controlBar.remainingTimeDisplay,b),b?this.controlBar.timeDivider.unblank():this.controlBar.timeDivider.blank())},b.prototype.handleTechClick_=function(a){0===a.button&&(this.controls()&&(this.paused()?this.play():this.pause()),this.trigger("tech-click"))},b.prototype.handleTechTap_=function(){this.userActive(!this.userActive())},b.prototype.handleTechTouchStart_=function(){this.userWasActive=this.userActive()},b.prototype.handleTechTouchMove_=function(){this.userWasActive&&this.reportUserActivity()},b.prototype.handleTechTouchEnd_=function(a){a.preventDefault()},b.prototype.handleFullscreenChange_=function(){this.isFullscreen()?(q.addElClass(this.multiPlayerContainerDiv,"vjs-fullscreen"),q.removeElClass(this.multiPlayerContainerDiv,"vjs-fluid")):(this.fluid()&&q.addElClass(this.multiPlayerContainerDiv,"vjs-fluid"),q.removeElClass(this.multiPlayerContainerDiv,"vjs-fullscreen"),this.updateStyleEl_())},b.prototype.handleStageClick_=function(){this.reportUserActivity()},b.prototype.handleTechFullscreenChange_=function(a,b){b&&this.isFullscreen(b.isFullscreen),this.trigger("fullscreenchange")},b.prototype.handleTechError_=function(){var a=this.tech_.error();this.error(a)},b.prototype.handleTechSuspend_=function(){this.trigger("suspend")},b.prototype.handleTechAbort_=function(){this.trigger("abort")},b.prototype.handleTechEmptied_=function(){this.trigger("emptied")},b.prototype.handleTechStalled_=function(){this.trigger("stalled")},b.prototype.handleTechLoadedMetaData_=function(){this.error(null),this.trigger("loadedmetadataInternal"),this.trigger("loadedmetadata")},b.prototype.handleTechTextData_=function(){var a=null;arguments.length>1&&(a=arguments[1]),this.trigger("textdata",a)},b.prototype.handleTechLoadedData_=function(){this.trigger("loadeddata")},b.prototype.handleTechTimeUpdate_=function(){if(this.trigger("timeupdate"),"AzureHtml5JS"===this.techName_){var a=this.currentTime(),b=this.duration();a>b&&this.duration(a)}},b.prototype.handleTechRateChange_=function(){this.trigger("ratechange")},b.prototype.handleTechVolumeChange_=function(){this.trigger("volumechange")},b.prototype.handleTechTextTrackChange_=function(){this.trigger("texttrackchange")},b.prototype.getCache=function(){return this.cache_},b.prototype.techCall_=function(a,b){if(this.tech_&&!this.tech_.isReady_)this.tech_.ready(function(){this[a](b)},!0);else try{this.tech_&&this.tech_[a](b)}catch(c){throw y["default"](c),c}},b.prototype.techGet_=function(a){if(this.tech_&&this.tech_.isReady_)try{return this.tech_[a]()}catch(b){throw void 0===this.tech_[a]?y["default"]("Video.js: "+a+" method not defined for "+this.techName_+" playback technology.",b):"TypeError"===b.name?(y["default"]("Video.js: "+a+" unavailable on "+this.techName_+" playback technology element.",b),this.tech_.isReady_=!1):y["default"](b),b}},b.prototype.techGetWithParams_=function(a,b){if(this.tech_&&this.tech_.isReady_)try{var c;return(c=this.tech_)[a].apply(c,b)}catch(d){throw void 0===this.tech_[a]?y["default"]("Video.js: "+a+" method not defined for "+this.techName_+" playback technology.",d):"TypeError"===d.name?(y["default"]("Video.js: "+a+" unavailable on "+this.techName_+" playback technology element.",d),this.tech_.isReady_=!1):y["default"](d),d}},b.prototype.play=function(){return this.src()||this.currentSrc()?this.techCall_("play"):this.tech_.one("loadstart",function(){this.play()}),this},b.prototype.pause=function(){return this.techCall_("pause"),this},b.prototype.paused=function(){return this.techGet_("paused")===!1?!1:!0},b.prototype.scrubbing=function(a){return void 0!==a?(this.scrubbing_=!!a,a?this.addClass("vjs-scrubbing"):this.removeClass("vjs-scrubbing"),this):this.scrubbing_},b.prototype.currentTime=function(a){var b=this.techGet_("currentTime")||0;if(void 0!==a){this.trigger("currentTimeChanging",{time:a});var c=this.duration();return 0>=a?a=0:a>=c&&(a=c-.1),this.techCall_("setCurrentTime",a),b>a&&this.trigger("rewind"),this}return this.cache_.currentTime=b},b.prototype.getWallClockTime=function(a,b,c,d,e){return this.techGetWithParams_("getWallClockTime",[a,b,c,d,e])},b.prototype.restartCheckMediaWorkflowIfNeeded=function(){this.techCall_("restartCheckMediaWorkflowIfNeeded")},b.prototype.presentationTimeFromPercentageOfDvrWindow=function(a){return this.techGetWithParams_("presentationTimeFromPercentageOfDvrWindow",[a])},b.prototype.duration=function(a){return void 0===a?this.cache_.duration||0:(a=parseFloat(a)||0,0>a&&(a=1/0),a!==this.cache_.duration&&(this.cache_.duration=a,a===1/0?this.addClass("vjs-live"):this.removeClass("vjs-live"),this.trigger("durationchange")),this)},b.prototype.remainingTime=function(){return this.duration()-this.currentTime()},b.prototype.buffered=function c(){var c=this.techGet_("buffered");return c&&c.length||(c=D.createTimeRange(0,0)),c},b.prototype.bufferedPercent=function(){return E.bufferedPercent(this.buffered(),this.duration())},b.prototype.bufferedEnd=function(){var a=this.buffered(),b=this.duration(),c=a.end(a.length-1);return c>b&&(c=b),c},b.prototype.volume=function(a){var b=void 0;return void 0!==a?(b=Math.max(0,Math.min(1,parseFloat(a))),this.cache_.volume=b,this.techCall_("setVolume",b),this):(b=parseFloat(this.techGet_("volume")),isNaN(b)?1:b)},b.prototype.muted=function(a){return void 0!==a?(a?this.cache_.muted=!0:(this.cache_.muted=!1,void 0!==this.cache_.volume&&this.volume(this.cache_.volume)),this.techCall_("setMuted",a),this.trigger(a?"mute":"unmute"),this):this.techGet_("muted")||!1},b.prototype.supportsFullScreen=function(){return this.techGet_("supportsFullScreen")||!1},b.prototype.isFullscreen=function(a){return void 0!==a?(this.isFullscreen_=!!a,this):!!this.isFullscreen_},b.prototype.requestFullscreen=function(){var a=I["default"];return this.isFullscreen(!0),a.requestFullscreen?(o.on(k["default"],a.fullscreenchange,s.bind(this,function b(){this.isFullscreen(k["default"][a.fullscreenElement]),this.isFullscreen()===!1&&o.off(k["default"],a.fullscreenchange,b),this.trigger("fullscreenchange")})),this.multiPlayerContainerDiv[a.requestFullscreen]()):this.tech_.supportsFullScreen()?this.techCall_("enterFullScreen"):(this.enterFullWindow(),this.trigger("fullscreenchange")),this},b.prototype.exitFullscreen=function(){var a=I["default"];return this.isFullscreen(!1),a.requestFullscreen?k["default"][a.exitFullscreen]():this.tech_.supportsFullScreen()?this.techCall_("exitFullScreen"):(this.exitFullWindow(),this.trigger("fullscreenchange")),this},b.prototype.enterFullWindow=function(){this.isFullWindow=!0,this.docOrigOverflow=k["default"].documentElement.style.overflow,o.on(k["default"],"keydown",s.bind(this,this.fullWindowOnEscKey)),k["default"].documentElement.style.overflow="hidden",q.addElClass(k["default"].body,"vjs-full-window"),this.trigger("enterFullWindow")},b.prototype.fullWindowOnEscKey=function(a){27===a.keyCode&&(this.isFullscreen()===!0?this.exitFullscreen():this.exitFullWindow())},b.prototype.exitFullWindow=function(){this.isFullWindow=!1,o.off(k["default"],"keydown",this.fullWindowOnEscKey),k["default"].documentElement.style.overflow=this.docOrigOverflow,q.removeElClass(k["default"].body,"vjs-full-window"),this.trigger("exitFullWindow")},b.prototype.canPlayType=function(a){for(var b=void 0,c=0,d=this.options_.techOrder;c0&&(h=this.setTimeout(function(){if(!this.userActivity_&&this.isVisible()){var a=this.children_.filter(function(a){return"moreOptionsDialog"===a.name_});if(a[0]&&a[0].el().contains(k["default"].activeElement))return;this.userActive(!1)}},a))}},250)}},b.prototype.playbackRate=function(a){return void 0!==a?(this.techCall_("setPlaybackRate",a),this):this.tech_&&this.tech_.featuresPlaybackRate?this.techGet_("playbackRate"):1},b.prototype.isAudio=function(a){return void 0!==a?(this.isAudio_=!!a,this):!!this.isAudio_},b.prototype.handleKeyPress=function(a){if(this.controls()&&this.isFullscreen()&&a.target===this.el_&&a.shiftKey&&9===a.which&&this.controls_){a.preventDefault();var b=this;setTimeout(function(){b.ariaAlerts.reverseFocus()},250)}},b.prototype.networkState=function(){return this.techGet_("networkState")},b.prototype.readyState=function(){return this.techGet_("readyState")},b.prototype.videoTracks=function(){return this.tech_?this.tech_.videoTracks():(this.videoTracks_=this.videoTracks_||new W["default"],this.videoTracks_)},b.prototype.audioTracks=function(){return this.tech_?this.tech_.audioTracks():(this.audioTracks_=this.audioTracks_||new U["default"],this.audioTracks_)},b.prototype.textTracks=function(){return this.tech_&&this.tech_.textTracks()},b.prototype.remoteTextTracks=function(){return this.tech_&&this.tech_.remoteTextTracks()},b.prototype.remoteTextTrackEls=function(){return this.tech_&&this.tech_.remoteTextTrackEls()},b.prototype.addTextTrack=function(a,b,c){return this.tech_&&this.tech_.addTextTrack(a,b,c)},b.prototype.addRemoteTextTrack=function(a){return this.tech_&&this.tech_.addRemoteTextTrack(a)},b.prototype.removeRemoteTextTrack=function(){var a=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],b=a.track,c=void 0===b?arguments[0]:b;this.tech_&&this.tech_.removeRemoteTextTrack(c)},b.prototype.videoWidth=function(){return this.tech_&&this.tech_.videoWidth&&this.tech_.videoWidth()||0},b.prototype.videoHeight=function(){return this.tech_&&this.tech_.videoHeight&&this.tech_.videoHeight()||0},b.prototype.language=function(a){return void 0===a?this.language_:(this.language_=(""+a).toLowerCase(),this)},b.prototype.languages=function(){return b.prototype.options_.languagesMutated&&(b.prototype.options_.languagesMutated=!1,this.languages_=Q["default"](b.prototype.options_.languages,this.languages_)),this.languages_},b.prototype.toJSON=function(){var a=Q["default"](this.options_),b=a.tracks;a.tracks=[];for(var c=0;ci;i++){var k=h[i],l=k.nodeName.toLowerCase(),m=q.getElAttributes(k),n=m["data-setup"];if(null!==n){var o=M["default"](n||"{}"),f=o[0],g=o[1];f&&y["default"].error(f),O["default"](m,g)}"source"===l?b.sources.push(m):"track"===l&&b.tracks.push(m)}return b},b}(i["default"]));oa.players={}; var pa=m["default"].navigator;oa.prototype.options_={techOrder:["html5","flash"],html5:{},flash:{},defaultVolume:0,inactivityTimeout:5e3,playbackRates:[],children:["mediaLoader","fullscreenOutline","posterImage","textTrackDisplay","loadingSpinner","bigPauseButton","bigPlayButton","controlBar","errorDisplay","textTrackSettings","ariaAlerts"],language:pa.languages&&pa.languages[0]||pa.userLanguage||pa.language||"en",languages:{},notSupportedMessage:"No compatible source was found for this media.",plugins:{},manifestFetchAutoRetryForLive:!1,maxRetryCountForLive:5,retryIntervalForLiveInMSec:2e3,playerStartupTimeoutInMSec:1e4,playerStartupTimeoutTimer:!1},oa.prototype.handleTechLoadStart_,oa.prototype.handleLoadedMetaData_,oa.prototype.handleTextData_,oa.prototype.handleLoadedData_,oa.prototype.handleUserActive_,oa.prototype.handleUserInactive_,oa.prototype.handleTimeUpdate_,oa.prototype.handleTechEnded_,oa.prototype.handleVolumeChange_,oa.prototype.handleError_,oa.prototype.flexNotSupported_=function(){var a=k["default"].createElement("i");return!("flexBasis"in a.style||"webkitFlexBasis"in a.style||"mozFlexBasis"in a.style||"msFlexBasis"in a.style||"msFlexOrder"in a.style)},i["default"].registerComponent("Player",oa),c["default"]=oa,b.exports=c["default"]},{"./FullscreenOutline.js":157,"./aria-alerts.js":158,"./big-play-button.js":159,"./component.js":163,"./control-bar/control-bar.js":166,"./error-display.js":200,"./fullscreen-api.js":203,"./loading-spinner.js":204,"./media-error.js":205,"./modal-dialog":209,"./poster-image.js":214,"./tech/html5.js":219,"./tech/loader.js":220,"./tech/tech.js":222,"./tracks/audio-track-list.js":224,"./tracks/text-track-display.js":229,"./tracks/text-track-list-converter.js":230,"./tracks/text-track-settings.js":232,"./tracks/video-track-list.js":237,"./utils/browser.js":239,"./utils/buffer.js":240,"./utils/dom.js":242,"./utils/events.js":243,"./utils/fn.js":244,"./utils/font-checker.js":245,"./utils/guid.js":247,"./utils/highContrastCheck.js":248,"./utils/log.js":250,"./utils/merge-options.js":251,"./utils/stylesheet.js":252,"./utils/time-ranges.js":253,"./utils/to-camel-case.js":254,"./utils/to-title-case.js":255,"global/document":79,"global/window":80,"object.assign":73,"safe-json-parse/tuple":76}],211:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}c.__esModule=!0;var e=a("./player.js"),f=d(e),g=function(a,b){f["default"].prototype[a]=b};c["default"]=g,b.exports=c["default"]},{"./player.js":210}],212:[function(a,b,c){"use strict";function d(a){if(a&&a.__esModule)return a;var b={};if(null!=a)for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b[c]=a[c]);return b["default"]=a,b}function e(a){return a&&a.__esModule?a:{"default":a}}function f(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function g(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)}c.__esModule=!0;var h=a("../clickable-component.js"),i=e(h),j=a("../component.js"),k=e(j),l=a("./popup.js"),m=(e(l),a("../utils/dom.js")),n=(d(m),a("../utils/fn.js")),o=(d(n),a("../utils/to-title-case.js")),p=(e(o),function(a){function b(c){var d=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];f(this,b),a.call(this,c,d),this.update()}return g(b,a),b.prototype.update=function(){var a=this.createPopup();this.popup&&this.removeChild(this.popup),this.popup=a,this.addChild(a),this.items&&0===this.items.length?this.hide():this.items&&this.items.length>1&&this.show()},b.prototype.createPopup=function(){},b.prototype.createEl=function(){return a.prototype.createEl.call(this,"div",{className:this.buildCSSClass()})},b.prototype.buildCSSClass=function(){var b="vjs-menu-button";return b+=this.options_.inline===!0?"-inline":"-popup","vjs-menu-button "+b+" "+a.prototype.buildCSSClass.call(this)},b}(i["default"]));k["default"].registerComponent("PopupButton",p),c["default"]=p,b.exports=c["default"]},{"../clickable-component.js":161,"../component.js":163,"../utils/dom.js":242,"../utils/fn.js":244,"../utils/to-title-case.js":255,"./popup.js":213}],213:[function(a,b,c){"use strict";function d(a){if(a&&a.__esModule)return a;var b={};if(null!=a)for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b[c]=a[c]);return b["default"]=a,b}function e(a){return a&&a.__esModule?a:{"default":a}}function f(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function g(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)}c.__esModule=!0;var h=a("../component.js"),i=e(h),j=a("../utils/dom.js"),k=d(j),l=a("../utils/fn.js"),m=d(l),n=a("../utils/events.js"),o=d(n),p=function(a){function b(){f(this,b),a.apply(this,arguments)}return g(b,a),b.prototype.addItem=function(a){this.addChild(a),a.on("click",m.bind(this,function(){this.unlockShowing()}))},b.prototype.createEl=function(){var b=this.options_.contentElType||"ul";this.contentEl_=k.createEl(b,{className:"vjs-menu-content"});var c=a.prototype.createEl.call(this,"div",{append:this.contentEl_,className:"vjs-menu"});return c.appendChild(this.contentEl_),o.on(c,"click",function(a){a.preventDefault(),a.stopImmediatePropagation()}),c},b}(i["default"]);i["default"].registerComponent("Popup",p),c["default"]=p,b.exports=c["default"]},{"../component.js":163,"../utils/dom.js":242,"../utils/events.js":243,"../utils/fn.js":244}],214:[function(a,b,c){"use strict";function d(a){if(a&&a.__esModule)return a;var b={};if(null!=a)for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b[c]=a[c]);return b["default"]=a,b}function e(a){return a&&a.__esModule?a:{"default":a}}function f(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function g(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)}c.__esModule=!0;var h=a("./clickable-component.js"),i=e(h),j=a("./component.js"),k=e(j),l=a("./utils/fn.js"),m=d(l),n=a("./utils/dom.js"),o=d(n),p=a("./utils/browser.js"),q=(d(p),a("./utils/url.js")),r=d(q),s=a("./utils/log.js"),t=e(s),u=function(a){function b(c,d){f(this,b),a.call(this,c,d),this.update(),c.on("posterchange",m.bind(this,this.update)),c.on("fullscreenchange",m.bind(this,this.updateCss)),c.addThrottledWindowResizeListener(m.bind(this,this.updateCss),50)}return g(b,a),b.prototype.dispose=function(){this.player().off("fullscreenchange",this.updateCss),this.player().off("posterchange",this.update),a.prototype.dispose.call(this)},b.prototype.createEl=function(){var a=o.createEl("div",{className:"vjs-poster",tabIndex:-1});return this.span=o.createEl("span",{className:"vjs-poster-span",tabIndex:-1}),a.appendChild(this.span),this.fallbackImg_=o.createEl("img"),a.appendChild(this.fallbackImg_),a},b.prototype.update=function(){var a=this.player().poster();this.setSrc(a),a?this.show():this.hide()},b.prototype.setSrc=function(a){if(a&&(a=r.getAbsoluteURL(a),-1===a.search(/^(https?:)?\/\//i)&&(t["default"].warn("ignoring invalid poster URL"),a="")),this.fallbackImg_){var b=this;this.fallbackImg_.onload=function(){b.updateCss()},this.fallbackImg_.src=a,this.fallbackImg_.style.display="none",this.addCrossOriginPolicy(this.player().options().corsPolicy,this.fallbackImg_),setTimeout(function(){b.updateCss()},500)}else{var c="";a&&(c='url("'+a+'")'),this.el_.style.backgroundImage=c}},b.prototype.updateCss=function(){this.fallbackImg_.style.display="inline";var a="100%",b="auto";if(this.fallbackImg_.naturalHeight&&this.fallbackImg_.naturalWidth&&this.fallbackImg_.parentElement){var c=this.fallbackImg_.parentElement.clientWidth,d=this.fallbackImg_.parentElement.clientHeight;if(d&&c){var e=c/d,f=this.fallbackImg_.naturalWidth/this.fallbackImg_.naturalHeight;e>f&&(b="100%",a="auto")}else this.fallbackImg_.naturalHeight>this.fallbackImg_.naturalWidth&&(b="100%",a="auto")}if(this.player_){var g=this.player_.options_.posterAltString?this.player_.options_.posterAltString:"";o.setElAttributes(this.fallbackImg_,{width:a,height:b,alt:this.player_.htmlEncode(g)}),""===g&&o.setElAttributes(this.fallbackImg_,{role:"presentation"})}},b.prototype.handleClick=function(){this.player_.paused()?this.player_.play():this.player_.pause()},b}(i["default"]);k["default"].registerComponent("PosterImage",u),c["default"]=u,b.exports=c["default"]},{"./clickable-component.js":161,"./component.js":163,"./utils/browser.js":239,"./utils/dom.js":242,"./utils/fn.js":244,"./utils/log.js":250,"./utils/url.js":256}],215:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a){if(a&&a.__esModule)return a;var b={};if(null!=a)for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b[c]=a[c]);return b["default"]=a,b}c.__esModule=!0;var f=a("./utils/events.js"),g=e(f),h=a("global/document"),i=d(h),j=a("global/window"),k=d(j),l=!1,m=void 0,n=function(){var a=i["default"].getElementsByTagName("video"),b=i["default"].getElementsByTagName("audio"),c=[];if(a&&a.length>0)for(var d=0,e=a.length;e>d;d++)c.push(a[d]);if(b&&b.length>0)for(var d=0,e=b.length;e>d;d++)c.push(b[d]);if(c&&c.length>0)for(var d=0,e=c.length;e>d;d++){var f=c[d];if(!f||!f.getAttribute){o(1);break}if(void 0===f.player){var g=f.getAttribute("data-setup");if(null!==g){m(f)}}}else l||o(1)},o=function(a,b){b&&(m=b),setTimeout(n,a)};"complete"===i["default"].readyState?l=!0:g.one(k["default"],"load",function(){l=!0});var p=function(){return l};c.autoSetup=n,c.autoSetupTimeout=o,c.hasLoaded=p},{"./utils/events.js":243,"global/document":79,"global/window":80}],216:[function(a,b,c){"use strict";function d(a){if(a&&a.__esModule)return a;var b={};if(null!=a)for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b[c]=a[c]);return b["default"]=a,b}function e(a){return a&&a.__esModule?a:{"default":a}}function f(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function g(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)}c.__esModule=!0;var h=a("../component.js"),i=e(h),j=a("../utils/dom.js"),k=d(j),l=a("object.assign"),m=e(l),n=function(a){function b(c,d){f(this,b),a.call(this,c,d),this.bar=this.getChild(this.options_.barName),this.seekHandle=this.getChild(this.options_.handleName),c.controls_&&this.vertical(!!this.options_.vertical),this.on("mousedown",this.handleMouseDown),this.on("touchstart",this.handleMouseDown),this.on("focus",this.handleFocus),this.on("blur",this.handleBlur),this.on("click",this.handleClick),this.on(c,"controlsvisible",this.update),this.on(c,this.playerEvent,this.update)}return g(b,a),b.prototype.createEl=function(b){var c=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],d=arguments.length<=2||void 0===arguments[2]?{}:arguments[2];return c.className=c.className+" vjs-slider",c=m["default"]({tabIndex:0},c),d=m["default"]({role:"slider","aria-valuenow":0,"aria-valuemin":0,"aria-valuemax":100,tabIndex:0},d),a.prototype.createEl.call(this,b,c,d)},b.prototype.handleMouseDown=function(a){var b=this.bar.el_.ownerDocument;a.preventDefault(),k.blockTextSelection(),this.addClass("vjs-sliding"),this.trigger("slideractive"),this.on(b,"mousemove",this.handleMouseMove),this.on(b,"mouseup",this.handleMouseUp),this.on(b,"touchmove",this.handleMouseMove),this.on(b,"touchend",this.handleMouseUp),this.handleMouseMove(a)},b.prototype.handleMouseMove=function(){},b.prototype.handleMouseUp=function(){var a=this.bar.el_.ownerDocument;k.unblockTextSelection(),this.removeClass("vjs-sliding"),this.trigger("sliderinactive"),this.off(a,"mousemove",this.handleMouseMove),this.off(a,"mouseup",this.handleMouseUp),this.off(a,"touchmove",this.handleMouseMove),this.off(a,"touchend",this.handleMouseUp),this.update()},b.prototype.update=function(){if(this.el_){var a=this.getPercent(),b=this.bar;if(b){("number"!=typeof a||a!==a||0>a||a===1/0)&&(a=0);var c=(100*a).toFixed(2)+"%";this.vertical()?b.el().style.height=c:b.el().style.width=c,this.seekHandle&&this.seekHandle.update()}}},b.prototype.calculateDistance=function(a){var b=k.getPointerPosition(this.el_,a);return this.vertical()?b.y:b.x},b.prototype.handleFocus=function(){this.on(this.bar.el_.ownerDocument,"keydown",this.handleKeyPress)},b.prototype.handleKeyPress=function(a){37===a.which||40===a.which?(a.preventDefault(),this.stepBack()):(38===a.which||39===a.which)&&(a.preventDefault(),this.stepForward())},b.prototype.handleBlur=function(){this.off(this.bar.el_.ownerDocument,"keydown",this.handleKeyPress)},b.prototype.handleClick=function(a){a.stopImmediatePropagation(),a.preventDefault()},b.prototype.vertical=function(a){return void 0===a?this.vertical_||!1:(this.vertical_=!!a,this.addClass(this.vertical_?"vjs-slider-vertical":"vjs-slider-horizontal"),this)},b}(i["default"]);i["default"].registerComponent("Slider",n),c["default"]=n,b.exports=c["default"]},{"../component.js":163,"../utils/dom.js":242,"object.assign":73}],217:[function(a,b,c){"use strict";function d(a){return a.streamingFormats={"rtmp/mp4":"MP4","rtmp/flv":"FLV"},a.streamFromParts=function(a,b){return a+"&"+b},a.streamToParts=function(a){var b={connection:"",stream:""};if(!a)return b;var c=a.search(/&(?!\w+=)/),d=void 0;return-1!==c?d=c+1:(c=d=a.lastIndexOf("/")+1,0===c&&(c=d=a.length)),b.connection=a.substring(0,c),b.stream=a.substring(d,a.length),b},a.isStreamingType=function(b){return b in a.streamingFormats},a.RTMP_RE=/^rtmp[set]?:\/\//i,a.isStreamingSrc=function(b){return a.RTMP_RE.test(b)},a.rtmpSourceHandler={},a.rtmpSourceHandler.canPlayType=function(b){return a.isStreamingType(b)?"maybe":""},a.rtmpSourceHandler.canHandleSource=function(b){var c=a.rtmpSourceHandler.canPlayType(b.type);return c?c:a.isStreamingSrc(b.src)?"maybe":""},a.rtmpSourceHandler.handleSource=function(b,c){var d=a.streamToParts(b.src);c.setRtmpConnection(d.connection),c.setRtmpStream(d.stream)},a.registerSourceHandler(a.rtmpSourceHandler),a}c.__esModule=!0,c["default"]=d,b.exports=c["default"]},{}],218:[function(a,b,c){"use strict";function d(a){if(a&&a.__esModule)return a;var b={};if(null!=a)for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b[c]=a[c]);return b["default"]=a,b}function e(a){return a&&a.__esModule?a:{"default":a}}function f(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function g(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)}function h(a){var b=a.charAt(0).toUpperCase()+a.slice(1);A["set"+b]=function(b){return this.el_.vjs_setProperty(a,b)}}function i(a){A[a]=function(){return this.el_.vjs_getProperty(a)}}c.__esModule=!0;for(var j=a("./tech"),k=e(j),l=a("../utils/dom.js"),m=d(l),n=a("../utils/url.js"),o=d(n),p=a("../utils/time-ranges.js"),q=a("./swfobject.js"),r=a("./flash-rtmp"),s=e(r),t=a("../component"),u=e(t),v=a("global/window"),w=e(v),x=a("object.assign"),y=e(x),z=(w["default"].navigator,function(a){function b(c,d){f(this,b),a.call(this,c,d),c.source&&this.ready(function(){this.setSource(c.source)},!0),c.startTime&&this.ready(function(){this.load(),this.play(),this.currentTime(c.startTime)},!0),w["default"].videojs=w["default"].videojs||{},w["default"].videojs.Flash=w["default"].videojs.Flash||{},w["default"].videojs.Flash.onReady=b.onReady,w["default"].videojs.Flash.onEvent=b.onEvent,w["default"].videojs.Flash.onError=b.onError,this.on("seeked",function(){this.lastSeekTarget_=void 0})}return g(b,a),b.prototype.createEl=function(){var a=this.options_,c=a.techId,d=y["default"]({readyFunction:"videojs.Flash.onReady",eventProxyFunction:"videojs.Flash.onEvent",errorEventProxyFunction:"videojs.Flash.onError",autoplay:a.autoplay,preload:a.preload,loop:a.loop,muted:a.muted},a.flashVars),e=y["default"]({wmode:"opaque",bgcolor:"#000000"},a.params),f=y["default"]({id:c,name:c,"class":"vjs-tech"},a.attributes);return this.el_=b.embed(a.swf,d,e,f),this.el_.tech=this,this.el_},b.prototype.play=function(){this.ended()&&this.setCurrentTime(0),this.el_.vjs_play()},b.prototype.pause=function(){this.el_.vjs_pause()},b.prototype.src=function(a){return void 0===a?this.currentSrc():this.setSrc(a)},b.prototype.setSrc=function(a){if(a=o.getAbsoluteURL(a),this.el_.vjs_src(a),this.autoplay()){var b=this;this.setTimeout(function(){b.play()},0)}},b.prototype.seeking=function(){return void 0!==this.lastSeekTarget_},b.prototype.setCurrentTime=function(b){var c=this.seekable();c.length&&(b=b>c.start(0)?b:c.start(0),b=b=0?c:1/0},b.prototype.load=function(){this.el_.vjs_load()},b.prototype.poster=function(){this.el_.vjs_getProperty("poster")},b.prototype.setPoster=function(){},b.prototype.seekable=function(){var a=this.duration();return 0===a?p.createTimeRange():p.createTimeRange(0,a)},b.prototype.buffered=function(){var a=this.el_.vjs_getProperty("buffered");return 0===a.length?p.createTimeRange():p.createTimeRange(a[0][0],a[0][1])},b.prototype.supportsFullScreen=function(){return!1},b.prototype.enterFullScreen=function(){return!1},b}(k["default"])),A=z.prototype,B="rtmpConnection,rtmpStream,preload,defaultPlaybackRate,playbackRate,autoplay,loop,mediaGroup,controller,controls,volume,muted,defaultMuted".split(","),C="networkState,readyState,initialTime,startOffsetTime,paused,ended,videoWidth,videoHeight".split(","),D=0;D'}),d=y["default"]({data:a,width:"100%",height:"100%"},d),Object.getOwnPropertyNames(d).forEach(function(a){h+=encodeURIComponent(a)+'="'+encodeURI(d[a])+'" '}),""+e+h+">"+g+""},s["default"](z),u["default"].registerComponent("Flash",z),k["default"].registerTech("Flash",z),c["default"]=z,b.exports=c["default"]},{"../component":163,"../utils/dom.js":242,"../utils/time-ranges.js":253,"../utils/url.js":256,"./flash-rtmp":217,"./swfobject.js":221,"./tech":222,"global/window":80,"object.assign":73}],219:[function(a,b,c){"use strict";function d(a){if(a&&a.__esModule)return a;var b={};if(null!=a)for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b[c]=a[c]);return b["default"]=a,b}function e(a){return a&&a.__esModule?a:{"default":a}}function f(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function g(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)}function h(a,b){return a.raw=b,a}c.__esModule=!0;var i=h(["Text Tracks are being loaded from another origin but the crossorigin attribute isn't used. \n This may prevent text tracks from loading."],["Text Tracks are being loaded from another origin but the crossorigin attribute isn't used. \n This may prevent text tracks from loading."]),j=a("./tech.js"),k=e(j),l=a("../component"),m=e(l),n=a("../utils/dom.js"),o=d(n),p=a("../utils/url.js"),q=d(p),r=a("../utils/fn.js"),s=d(r),t=a("../utils/log.js"),u=e(t),v=a("tsml"),w=e(v),x=a("../../../src/js/tracks/text-track.js"),y=(e(x),a("../utils/browser.js")),z=d(y),A=a("global/document"),B=e(A),C=a("global/window"),D=e(C),E=a("object.assign"),F=e(E),G=a("../utils/merge-options.js"),H=e(G),I=a("../utils/to-title-case.js"),J=e(I),K=a("../utils/guid.js"),L=d(K),M=function(a){function b(c,d){var e=this;f(this,b),a.call(this,c,d);var g=c.source,h=!1;if(g&&(this.el_.currentSrc!==g.src||c.tag&&3===c.tag.initNetworkState_)?this.setSource(g):this.handleLateInit_(this.el_),this.el_.hasChildNodes()){for(var j=this.el_.childNodes,k=j.length,l=[];k--;){var m=j[k],n=m.nodeName.toLowerCase();"track"===n&&(this.featuresNativeTextTracks?(this.remoteTextTrackEls().addTrackElement_(m),this.remoteTextTracks().addTrack_(m.track),h||this.el_.hasAttribute("crossorigin")||!q.isCrossOrigin(m.src)||(h=!0)):l.push(m))}for(var p=0;p=0;g--){var h=f[g],i={};"undefined"!=typeof this.options_[h]&&(i[h]=this.options_[h]),o.setElAttributes(a,i)}return a},b.prototype.handleLateInit_=function(a){var b=this;if(0!==a.networkState&&3!==a.networkState){if(0===a.readyState){var c=function(){var a=!1,c=function(){a=!0};b.on("loadstart",c);var d=function(){a||this.trigger("loadstart")};return b.on("loadedmetadata",d),b.ready(function(){this.off("loadstart",c),this.off("loadedmetadata",d),a||this.trigger("loadstart")}),{v:void 0}}();if("object"==typeof c)return c.v}var d=["loadstart"];d.push("loadedmetadata"),a.readyState>=2&&d.push("loadeddata"),a.readyState>=3&&d.push("canplay"),a.readyState>=4&&d.push("canplaythrough"),this.ready(function(){d.forEach(function(a){this.trigger(a)},this)})}},b.prototype.proxyNativeTextTracks_=function(){var a=this.el().textTracks;if(a){for(var b=0;b0)for(var c=0;c0&&(a="number"!=typeof M.TEST_VID.textTracks[0].mode),a&&z.IS_FIREFOX&&(a=!1),!a||"onremovetrack"in M.TEST_VID.textTracks||(a=!1),a},M.supportsNativeVideoTracks=function(){var a=!!M.TEST_VID.videoTracks;return a},M.supportsNativeAudioTracks=function(){var a=!!M.TEST_VID.audioTracks;return a},M.Events=["loadstart","suspend","abort","error","emptied","stalled","loadedmetadata","loadeddata","canplay","canplaythrough","playing","waiting","seeking","seeked","ended","durationchange","timeupdate","progress","play","pause","ratechange","volumechange"],M.prototype.featuresVolumeControl=M.canControlVolume(),M.prototype.featuresPlaybackRate=M.canControlPlaybackRate(),M.prototype.featuresPreload=M.isPreloadSupported(),M.prototype.movingMediaElementInDOM=!z.IS_IOS,M.prototype.featuresFullscreenResize=!0,M.prototype.featuresProgressEvents=!0,M.prototype.featuresNativeTextTracks=M.supportsNativeTextTracks(),M.prototype.featuresNativeVideoTracks=M.supportsNativeVideoTracks(),M.prototype.featuresNativeAudioTracks=M.supportsNativeAudioTracks();var O=void 0,P=/^application\/(?:x-|vnd\.apple\.)mpegurl/i,Q=/^video\/mp4/i;M.patchCanPlayType=function(){z.ANDROID_VERSION>=4&&(O||(O=M.TEST_VID.constructor.prototype.canPlayType),M.TEST_VID.constructor.prototype.canPlayType=function(a){return a&&P.test(a)?"maybe":O.call(this,a)}),z.IS_OLD_ANDROID&&(O||(O=M.TEST_VID.constructor.prototype.canPlayType),M.TEST_VID.constructor.prototype.canPlayType=function(a){return a&&Q.test(a)?"maybe":O.call(this,a)})},M.unpatchCanPlayType=function(){var a=M.TEST_VID.constructor.prototype.canPlayType;return M.TEST_VID.constructor.prototype.canPlayType=O,O=null,a},M.patchCanPlayType(),M.disposeMediaElement=function(a){if(a){for(a.parentNode&&a.parentNode.removeChild(a);a.hasChildNodes();)a.removeChild(a.firstChild);a.removeAttribute("src"),"function"==typeof a.load&&!function(){try{a.load()}catch(b){}}()}},M.resetMediaElement=function(a){if(a){for(var b=a.querySelectorAll("source"),c=b.length;c--;)a.removeChild(b[c]);a.removeAttribute("src"),"function"==typeof a.load&&!function(){try{a.load()}catch(b){}}()}},m["default"].registerComponent("Html5",M),k["default"].registerTech("Html5",M),c["default"]=M,b.exports=c["default"]},{"../../../src/js/tracks/text-track.js":233,"../component":163,"../utils/browser.js":239,"../utils/dom.js":242,"../utils/fn.js":244,"../utils/guid.js":247,"../utils/log.js":250,"../utils/merge-options.js":251,"../utils/to-title-case.js":255,"../utils/url.js":256,"./tech.js":222,"global/document":79,"global/window":80,"object.assign":73,tsml:77}],220:[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)}c.__esModule=!0;var g=a("../component.js"),h=d(g),i=a("./tech.js"),j=d(i),k=a("global/window"),l=(d(k),a("../utils/to-title-case.js")),m=d(l),n=function(a){function b(c,d,f){if(e(this,b),a.call(this,c,d,f),d.playerOptions.sources&&0!==d.playerOptions.sources.length)c.src(d.playerOptions.sources);else for(var g=0,i=d.playerOptions.techOrder;g is released under the MIT License */ "use strict";function d(a){return a&&a.__esModule?a:{"default":a}}c.__esModule=!0;var e=a("global/window"),f=d(e),g=a("global/document"),h=d(g),i=function(){function a(a){return parseInt(a,10)}function b(b){b+="";var c=n.pv,d=b.split(".");return d[0]=a(d[0]),d[1]=a(d[1])||0,d[2]=a(d[2])||0,d[3]=a(d[3])||0,c[0]>d[0]||c[0]===d[0]&&c[1]>d[1]||c[0]===d[0]&&c[1]===d[1]&&c[2]>d[2]||c[0]===d[0]&&c[1]===d[1]&&c[2]===d[2]&&c[3]>=d[3]?!0:!1}var c="undefined",d="object",e="Shockwave Flash",g="ShockwaveFlash.ShockwaveFlash",i="application/x-shockwave-flash",j=f["default"],k=h["default"],l=f["default"].navigator,m=!1,n=function(){var b=typeof k.getElementById!==c&&typeof k.getElementsByTagName!==c&&typeof k.createElement!==c,f=l.userAgent.toLowerCase(),h=l.platform.toLowerCase(),n=/win/.test(h?h:f),o=/mac/.test(h?h:f),p=/webkit/.test(f)?parseFloat(f.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):!1,q="Microsoft Internet Explorer"===l.appName,r=[0,0,0,145],s=null;if(typeof l.plugins!==c&&typeof l.plugins[e]===d)if(s=l.plugins[e].version,s&&typeof l.mimeTypes!==c&&l.mimeTypes[i]&&l.mimeTypes[i].enabledPlugin){m=!0,q=!1;var t=s.split(".");r[0]=a(t[0]),r[1]=a(t[1]),r[2]=a(t[2]),r[3]=a(t[3])}else s=l.plugins[e].description,s&&typeof l.mimeTypes!==c&&l.mimeTypes[i]&&l.mimeTypes[i].enabledPlugin&&(m=!0,q=!1,s=s.replace(/^.*\s+(\S+\s+\S+$)/,"$1"),r[0]=a(s.replace(/^(.*)\..*$/,"$1")),r[1]=a(s.replace(/^.*\.(.*)\s.*$/,"$1")),r[2]=/[a-zA-Z]/.test(s)?a(s.replace(/^.*[a-zA-Z]+(.*)$/,"$1")):0);else if(typeof j.ActiveXObject!==c)try{var u=new j.ActiveXObject(g);u&&(s=u.GetVariable("$version"),s&&(q=!0,s=s.split(" ")[1].split(","),r=[a(s[0]),a(s[1]),a(s[2])]))}catch(v){}return{w3:b,pv:r,wk:p,ie:q,win:n,mac:o}}();return{ua:n,hasFlashPlayerVersion:b}}();c.swfobject=i},{"global/document":79,"global/window":80}],222:[function(a,b,c){"use strict";function d(a){if(a&&a.__esModule)return a;var b={};if(null!=a)for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b[c]=a[c]);return b["default"]=a,b}function e(a){return a&&a.__esModule?a:{"default":a}}function f(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function g(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)}c.__esModule=!0;var h=a("../component"),i=e(h),j=a("../tracks/html-track-element"),k=e(j),l=a("../tracks/html-track-element-list"),m=e(l),n=a("../utils/merge-options.js"),o=e(n),p=a("../tracks/text-track"),q=e(p),r=a("../tracks/text-track-list"),s=e(r),t=a("../tracks/video-track"),u=(e(t),a("../tracks/video-track-list")),v=e(u),w=a("../tracks/audio-track-list"),x=e(w),y=a("../tracks/audio-track"),z=(e(y),a("../utils/fn.js")),A=d(z),B=a("../utils/log.js"),C=e(B),D=a("../utils/time-ranges.js"),E=a("../utils/buffer.js"),F=a("../media-error.js"),G=e(F),H=a("global/window"),I=e(H),J=a("global/document"),K=e(J),L=function(a){function b(){var c=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],d=arguments.length<=1||void 0===arguments[1]?function(){}:arguments[1];f(this,b),c.reportTouchActivity=!1,a.call(this,null,c,d),this.hasStarted_=!1,this.on("playing",function(){this.hasStarted_=!0}),this.on("loadstart",function(){this.hasStarted_=!1}),this.textTracks_=c.textTracks,this.videoTracks_=c.videoTracks,this.audioTracks_=c.audioTracks,this.featuresProgressEvents||this.manualProgressOn(),this.featuresTimeupdateEvents||this.manualTimeUpdatesOn(),(c.nativeCaptions===!1||c.nativeTextTracks===!1)&&(this.featuresNativeTextTracks=!1),this.featuresNativeTextTracks||this.on("ready",this.emulateTextTracks),this.initTextTrackListeners(),this.initTrackListeners(),this.emitTapEvents()}/*! Time Tracking -------------------------------------------------------------- */ return g(b,a),b.prototype.manualProgressOn=function(){this.on("durationchange",this.onDurationChange),this.manualProgress=!0,this.one("ready",this.trackProgress)},b.prototype.manualProgressOff=function(){this.manualProgress=!1,this.stopTrackingProgress(),this.off("durationchange",this.onDurationChange)},b.prototype.trackProgress=function(){this.stopTrackingProgress(),this.progressInterval=this.setInterval(A.bind(this,function(){var a=this.bufferedPercent();this.bufferedPercent_!==a&&this.trigger("progress"),this.bufferedPercent_=a,1===a&&this.stopTrackingProgress()}),500)},b.prototype.onDurationChange=function(){this.duration_=this.duration()},b.prototype.buffered=function(){return D.createTimeRange(0,0)},b.prototype.bufferedPercent=function(){return E.bufferedPercent(this.buffered(),this.duration_)},b.prototype.stopTrackingProgress=function(){this.clearInterval(this.progressInterval)},b.prototype.manualTimeUpdatesOn=function(){this.manualTimeUpdates=!0,this.on("play",this.trackCurrentTime),this.on("pause",this.stopTrackingCurrentTime),this.one("timeupdate",function(a){a.manuallyTriggered||(this.featuresTimeupdateEvents=!0,this.manualTimeUpdatesOff())})},b.prototype.manualTimeUpdatesOff=function(){this.manualTimeUpdates=!1,this.stopTrackingCurrentTime(),this.off("play",this.trackCurrentTime),this.off("pause",this.stopTrackingCurrentTime)},b.prototype.trackCurrentTime=function(){this.currentTimeInterval&&this.stopTrackingCurrentTime(),this.currentTimeInterval=this.setInterval(function(){this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},250)},b.prototype.stopTrackingCurrentTime=function(){this.clearInterval(this.currentTimeInterval),this.manualTimeUpdates&&this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},b.prototype.dispose=function(){this.clearTracks(["audio","video","text"]),this.manualProgress&&this.manualProgressOff(),this.manualTimeUpdates&&this.manualTimeUpdatesOff(),a.prototype.dispose.call(this)},b.prototype.clearTracks=function(a){var b=this;a=[].concat(a),a.forEach(function(a){for(var c=b[a+"Tracks"]()||[],d=c.length;d--;){var e=c[d];"text"===a&&b.removeRemoteTextTrack(e),c.removeTrack_(e)}})},b.prototype.reset=function(){},b.prototype.error=function(a){return void 0!==a&&(this.error_=a instanceof G["default"]?a:new G["default"](a),this.trigger("error")),this.error_},b.prototype.played=function(){return this.hasStarted_?D.createTimeRange(0,0):D.createTimeRange()},b.prototype.setCurrentTime=function(){this.manualTimeUpdates&&this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},b.prototype.initTextTrackListeners=function(){var a=A.bind(this,function(){this.trigger("texttrackchange")}),b=this.textTracks();b&&(b.addEventListener("removetrack",a),b.addEventListener("addtrack",a),this.on("dispose",A.bind(this,function(){b.removeEventListener("removetrack",a),b.removeEventListener("addtrack",a)})))},b.prototype.initTrackListeners=function(){var a=this,b=["video","audio"];b.forEach(function(b){var c=function(){a.trigger(b+"trackchange")},d=a[b+"Tracks"]();d.addEventListener("removetrack",c),d.addEventListener("addtrack",c),a.on("dispose",function(){d.removeEventListener("removetrack",c),d.removeEventListener("addtrack",c)})})},b.prototype.emulateTextTracks=function(){var a=this,b=this.textTracks();if(b){I["default"].WebVTT||null==this.el().parentNode||!function(){var b=K["default"].createElement("script");b.src=a.options_["vtt.js"]||"../node_modules/videojs-vtt.js/dist/vtt.js",b.onload=function(){a.trigger("vttjsloaded")},b.onerror=function(){a.trigger("vttjserror")},a.on("dispose",function(){b.onload=null,b.onerror=null}),I["default"].WebVTT=!0,a.el().parentNode.appendChild(b)}();var c=function(){return a.trigger("texttrackchange")},d=function(){c();for(var a=0;a500&&this.showKeyboardTooltip()},b.prototype.showKeyboardTooltip=function(){var a=this.el_.getAttribute("title");a&&void 0!==a&&(this.buttonTooltipEl_&&void 0!==this.buttonTooltipEl_||(this.buttonTooltipEl_=m.createEl("span",{className:"vjs-button-tooltip"}),this.el_.appendChild(this.buttonTooltipEl_),this.buttonTooltipEl_.innerHtml=this.buttonTooltipEl_.innerText=a))},b.prototype.clearKeyboardTooltip=function(){this.buttonTooltipEl_&&void 0!==this.buttonTooltipEl_&&(this.buttonTooltipEl_.innerHtml=this.buttonTooltipEl_.innerText=null,this.el_.removeChild(this.buttonTooltipEl_),this.buttonTooltipEl_=null)},b}(i["default"]);k["default"].registerComponent("TooltipClickable",n),c["default"]=n,b.exports=c["default"]},{"./clickable-component.js":161,"./component":163,"./utils/dom.js":242}],224:[function(a,b,c){"use strict";function d(a){if(a&&a.__esModule)return a;var b={};if(null!=a)for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b[c]=a[c]);return b["default"]=a,b}function e(a){return a&&a.__esModule?a:{"default":a}}function f(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function g(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)}c.__esModule=!0;var h=a("./track-list"),i=e(h),j=a("../utils/browser.js"),k=d(j),l=a("global/document"),m=e(l),n=function(a,b){for(var c=0;c=0;e--)if(c[e].enabled){n(c,c[e]);break}if(k.IS_IE8){d=m["default"].createElement("custom");for(var g in i["default"].prototype)"constructor"!==g&&(d[g]=i["default"].prototype[g]);for(var g in b.prototype)"constructor"!==g&&(d[g]=b.prototype[g])}return d=a.call(this,c,d),d.changing_=!1,d}return g(b,a),b.prototype.addTrack_=function(b){var c=this;b.enabled&&n(this,b),a.prototype.addTrack_.call(this,b),b.addEventListener&&b.addEventListener("enabledchange",function(){c.changing_||(c.changing_=!0,n(c,b),c.changing_=!1,c.trigger("change"))})},b.prototype.addTrack=function(a){this.addTrack_(a)},b.prototype.removeTrack=function(b){a.prototype.removeTrack_.call(this,b)},b}(i["default"]);c["default"]=o,b.exports=c["default"]},{"../utils/browser.js":239,"./track-list":235,"global/document":79}],225:[function(a,b,c){"use strict";function d(a){if(a&&a.__esModule)return a;var b={};if(null!=a)for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b[c]=a[c]);return b["default"]=a,b}function e(a){return a&&a.__esModule?a:{"default":a}}function f(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function g(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)}c.__esModule=!0;var h=a("./track-enums"),i=a("./track"),j=e(i),k=a("../utils/merge-options"),l=e(k),m=a("../utils/browser.js"),n=d(m),o=function(a){function b(){var c=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];f(this,b);var d=l["default"](c,{kind:h.AudioTrackKind[c.kind]||""}),e=a.call(this,d),g=!1;if(n.IS_IE8)for(var i in b.prototype)"constructor"!==i&&(e[i]=b.prototype[i]);return Object.defineProperty(e,"enabled",{get:function(){return g},set:function(a){"boolean"==typeof a&&a!==g&&(g=a,this.trigger("enabledchange"))}}),d.enabled&&(e.enabled=d.enabled),e.loaded_=!0,e}return g(b,a),b}(j["default"]);c["default"]=o,b.exports=c["default"]},{"../utils/browser.js":239,"../utils/merge-options":251,"./track":236,"./track-enums":234}],226:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a){if(a&&a.__esModule)return a;var b={};if(null!=a)for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b[c]=a[c]);return b["default"]=a,b}function f(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}c.__esModule=!0;var g=a("../utils/browser.js"),h=e(g),i=a("global/document"),j=d(i),k=function(){function a(){var b=arguments.length<=0||void 0===arguments[0]?[]:arguments[0];f(this,a);var c=this;if(h.IS_IE8){c=j["default"].createElement("custom");for(var d in a.prototype)"constructor"!==d&&(c[d]=a.prototype[d])}c.trackElements_=[],Object.defineProperty(c,"length",{get:function(){return this.trackElements_.length}});for(var e=0,g=b.length;g>e;e++)c.addTrackElement_(b[e]);return h.IS_IE8?c:void 0}return a.prototype.addTrackElement_=function(a){this.trackElements_.push(a)},a.prototype.getTrackElementByTrack_=function(a){for(var b=void 0,c=0,d=this.trackElements_.length;d>c;c++)if(a===this.trackElements_[c].track){b=this.trackElements_[c];break}return b},a.prototype.removeTrackElement_=function(a){for(var b=0,c=this.trackElements_.length;c>b;b++)if(a===this.trackElements_[b]){this.trackElements_.splice(b,1);break}},a}();c["default"]=k,b.exports=c["default"]},{"../utils/browser.js":239,"global/document":79}],227:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a){if(a&&a.__esModule)return a;var b={};if(null!=a)for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b[c]=a[c]);return b["default"]=a,b}function f(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function g(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)}c.__esModule=!0;var h=a("../utils/browser.js"),i=e(h),j=a("global/document"),k=d(j),l=a("../event-target"),m=d(l),n=a("../tracks/text-track"),o=d(n),p=0,q=1,r=2,s=3,t=function(a){function b(){var c=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];f(this,b),a.call(this);var d=void 0,e=this;if(i.IS_IE8){e=k["default"].createElement("custom");for(var g in b.prototype)"constructor"!==g&&(e[g]=b.prototype[g])}var h=new o["default"](c);return e.kind=h.kind,e.src=h.src,e.srclang=h.language,e.label=h.label,e["default"]=h["default"],Object.defineProperty(e,"readyState",{get:function(){return d}}),Object.defineProperty(e,"track",{get:function(){return h}}),d=p,h.addEventListener("loadeddata",function(){d=r,e.trigger({type:"load",target:e})}),i.IS_IE8?e:void 0}return g(b,a),b}(m["default"]);t.prototype.allowedEvents_={load:"load"},t.NONE=p,t.LOADING=q,t.LOADED=r,t.ERROR=s,c["default"]=t,b.exports=c["default"]},{"../event-target":201,"../tracks/text-track":233,"../utils/browser.js":239,"global/document":79}],228:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a){if(a&&a.__esModule)return a;var b={};if(null!=a)for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b[c]=a[c]);return b["default"]=a,b}function f(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}c.__esModule=!0;var g=a("../utils/browser.js"),h=e(g),i=a("global/document"),j=d(i),k=function(){function a(b){f(this,a);var c=this;if(h.IS_IE8){c=j["default"].createElement("custom");for(var d in a.prototype)"constructor"!==d&&(c[d]=a.prototype[d])}return a.prototype.setCues_.call(c,b),Object.defineProperty(c,"length",{get:function(){return this.length_}}),h.IS_IE8?c:void 0}return a.prototype.setCues_=function(a){var b=this.length||0,c=0,d=a.length;this.cues_=a,this.length_=a.length;var e=function(a){""+a in this||Object.defineProperty(this,""+a,{get:function(){return this.cues_[a]}})};if(d>b)for(c=b;d>c;c++)e.call(this,c)},a.prototype.getCueById=function(a){for(var b=null,c=0,d=this.length;d>c;c++){var e=this[c];if(e.id===a){b=e;break}}return b},a}();c["default"]=k,b.exports=c["default"]},{"../utils/browser.js":239,"global/document":79}],229:[function(a,b,c){"use strict";function d(a){if(a&&a.__esModule)return a;var b={};if(null!=a)for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b[c]=a[c]);return b["default"]=a,b}function e(a){return a&&a.__esModule?a:{"default":a}}function f(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function g(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)}function h(a,b){var c=[parseInt(a[1]+a[1],16),parseInt(a[2]+a[2],16),parseInt(a[3]+a[3],16)];return b?"rgba("+c.join(",")+","+b+")":"rgb("+c.join(",")+")"}function i(a,b,c){try{a.style[b]=c}catch(d){}}function j(a,b,c,d){try{for(var e=0;ef;f++)if(c[f]!==d[f])return!1;return!0}function n(a){return a&&a.className&&a.className.indexOf("bg_")>=0}c.__esModule=!0;var o=a("../component"),p=e(o),q=a("../menu/menu.js"),r=(e(q),a("../menu/menu-item.js")),s=(e(r),a("../menu/menu-button.js")),t=(e(s),a("../utils/fn.js")),u=d(t),v=a("global/document"),w=(e(v),a("global/window")),x=e(w),y="#222",z="#ccc",A={monospace:"monospace",sansSerif:"sans-serif",serif:"serif",monospaceSansSerif:'"Andale Mono", "Lucida Console", monospace',monospaceSerif:'"Courier New", monospace',proportionalSansSerif:"sans-serif",proportionalSerif:"serif",casual:'"Comic Sans MS", Impact, fantasy',script:'"Monotype Corsiva", cursive',smallcaps:'"Andale Mono", "Lucida Console", monospace, sans-serif'},B=function(a){function b(c,d,e){f(this,b),a.call(this,c,d,e),c.on("loadstart",u.bind(this,this.toggleDisplay)),c.on("texttrackchange",u.bind(this,this.updateDisplay)),c.ready(u.bind(this,function(){if(c.tech_&&c.tech_.featuresNativeTextTracks)return void this.hide();c.on("fullscreenchange",u.bind(this,this.updateDisplay));for(var a=this.options_.playerOptions.tracks||[],b=0;bc;c++)if(this[c]===a){b=this[c],b.off&&b.off(),this.tracks_.splice(c,1);break}b&&this.trigger({track:b,type:"removetrack"})},b.prototype.getTrackById=function(a){for(var b=null,c=0,d=this.length;d>c;c++){var e=this[c];if(e.id===a){b=e;break}}return b},b}(i["default"]);c["default"]=p,b.exports=c["default"]},{"../utils/browser.js":239,"../utils/fn.js":244,"./track-list":235,"global/document":79}],232:[function(a,b,c){"use strict";function d(a){if(a&&a.__esModule)return a;var b={};if(null!=a)for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b[c]=a[c]);return b["default"]=a,b}function e(a){return a&&a.__esModule?a:{"default":a}}function f(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function g(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)}function h(a){var b=void 0;return a.selectedOptions?b=a.selectedOptions[0]:a.options&&(b=a.options[a.options.selectedIndex]),b.value}function i(a,b){if(b){var c=void 0;for(c=0;cCaptions Settings Dialog\n
Beginning of dialog window. Escape will cancel and close the window.
\n
\n
\n
\n '+this.htmlEncode(this.localize("Text"))+'\n \n \n \n \n \n \n
\n
\n '+this.htmlEncode(this.localize("Background"))+'\n \n \n \n \n \n \n
\n
\n '+this.htmlEncode(this.localize("Window"))+'\n \n \n \n \n \n \n
\n
\n
\n
\n \n \n
\n
\n \n \n
\n
\n \n \n
\n
\n
\n \n \n
\n
\n '; return d}c.__esModule=!0;var k=a("../component"),l=e(k),m=a("../utils/fn.js"),n=d(m),o=a("../utils/log.js"),p=e(o),q=a("safe-json-parse/tuple"),r=e(q),s=a("global/window"),t=e(s),u=function(a){function b(c,d){var e=this;f(this,b),a.call(this,c,d),this.hide(),void 0===d.persistTextTrackSettings&&(this.options_.persistTextTrackSettings=this.options_.playerOptions.persistTextTrackSettings);var g="center";this.hiddenSettings={justification:g},this.on(this.$(".vjs-done-button"),"click",function(){e.saveSettings(),e.hide(),e.returnFocusBack()}),this.on(this.$(".vjs-done-button"),"keydown",this.handleKeyPress_DoneBtn),this.on(this.$(".vjs-fg-color"),"keydown",this.handleKeyPress_FgColor),this.on(this.$(".vjs-default-button"),"click",function(){e.$(".vjs-fg-color > select").selectedIndex=0,e.$(".vjs-bg-color > select").selectedIndex=0,e.$(".window-color > select").selectedIndex=0,e.$(".vjs-text-opacity > select").selectedIndex=0,e.$(".vjs-bg-opacity > select").selectedIndex=0,e.$(".vjs-window-opacity > select").selectedIndex=0,e.$(".vjs-edge-style select").selectedIndex=0,e.$(".vjs-font-family select").selectedIndex=0,e.$(".vjs-font-percent select").selectedIndex=2,e.updateDisplay()}),this.on(this.$(".vjs-fg-color > select"),"change",this.updateDisplay),this.on(this.$(".vjs-bg-color > select"),"change",this.updateDisplay),this.on(this.$(".window-color > select"),"change",this.updateDisplay),this.on(this.$(".vjs-text-opacity > select"),"change",this.updateDisplay),this.on(this.$(".vjs-bg-opacity > select"),"change",this.updateDisplay),this.on(this.$(".vjs-window-opacity > select"),"change",this.updateDisplay),this.on(this.$(".vjs-font-percent select"),"change",this.updateDisplay),this.on(this.$(".vjs-edge-style select"),"change",this.updateDisplay),this.on(this.$(".vjs-font-family select"),"change",this.updateDisplay),this.on(this.el_.ownerDocument,"keydown",n.bind(this,this.handleKeyPress)),this.options_.persistTextTrackSettings&&this.restoreSettings()}return g(b,a),b.prototype.createEl=function(){var b=this.id_,c="TTsettingsDialogLabel-"+b,d="TTsettingsDialogDescription-"+b;return a.prototype.createEl.call(this,"div",{className:"vjs-caption-settings vjs-modal-overlay",innerHTML:j.call(this,b,c,d),tabIndex:-1},{role:"dialog","aria-labelledby":c,"aria-describedby":d})},b.prototype.getValues=function(){var a=h(this.$(".vjs-edge-style select")),b=h(this.$(".vjs-font-family select")),c=h(this.$(".vjs-fg-color > select")),d=h(this.$(".vjs-text-opacity > select")),e=h(this.$(".vjs-bg-color > select")),f=h(this.$(".vjs-bg-opacity > select")),g=h(this.$(".window-color > select")),i=h(this.$(".vjs-window-opacity > select")),j=t["default"].parseFloat(h(this.$(".vjs-font-percent > select"))),k={backgroundOpacity:f,textOpacity:d,windowOpacity:i,edgeStyle:a,fontFamily:b,color:c,backgroundColor:e,windowColor:g,fontPercent:j,justification:this.hiddenSettings.justification};for(var l in k)(""===k[l]||"none"===k[l]||"fontPercent"===l&&1===k[l])&&delete k[l];return k},b.prototype.setValues=function(a){i(this.$(".vjs-edge-style select"),a.edgeStyle),i(this.$(".vjs-font-family select"),a.fontFamily),i(this.$(".vjs-fg-color > select"),a.color),i(this.$(".vjs-text-opacity > select"),a.textOpacity),i(this.$(".vjs-bg-color > select"),a.backgroundColor),i(this.$(".vjs-bg-opacity > select"),a.backgroundOpacity),i(this.$(".window-color > select"),a.windowColor),i(this.$(".vjs-window-opacity > select"),a.windowOpacity);var b=a.fontPercent;b&&(b=b.toFixed(2)),i(this.$(".vjs-font-percent > select"),b),a.justification&&(this.hiddenSettings.justification=a.justification)},b.prototype.restoreSettings=function(){var a=void 0,b=void 0;try{var c=r["default"](t["default"].localStorage.getItem("vjs-text-track-settings"));a=c[0],b=c[1],a&&p["default"].error(a)}catch(d){p["default"].warn(d)}b&&this.setValues(b)},b.prototype.saveSettings=function(){if(this.options_.persistTextTrackSettings){var a=this.getValues();try{Object.getOwnPropertyNames(a).length>0?t["default"].localStorage.setItem("vjs-text-track-settings",JSON.stringify(a)):t["default"].localStorage.removeItem("vjs-text-track-settings")}catch(b){p["default"].warn(b)}}},b.prototype.updateDisplay=function(){var a=this.player_.getChild("textTrackDisplay");a&&(a.updateDisplay(),a.setAsChangedByUser())},b.prototype.returnFocusBack=function(){var a=this.player_.controlBar.captionsButton.el().getElementsByClassName("vjs-lock-showing"),b=this.player_.controlBar.captionsButton.el().getElementsByClassName("vjs-texttrack-settings");null!==a&&void 0!==a&&a.length>0&&null!==b&&void 0!==b&&b.length>0?b[0].focus():this.player_.controlBar.captionsButton.el().focus()},b.prototype.handleKeyPress=function(a){this.hasClass("vjs-hidden")||27!==a.which||(this.hide(),this.returnFocusBack())},b.prototype.handleKeyPress_DoneBtn=function(a){a.shiftKey||9!==a.which||this.el().focus()},b.prototype.handleKeyPress_FgColor=function(a){if(a.shiftKey&&9===a.which){var b=this.el().getElementsByClassName("vjs-done-button");b[0].focus()}},b}(l["default"]);l["default"].registerComponent("TextTrackSettings",u),c["default"]=u,b.exports=c["default"]},{"../component":163,"../utils/fn.js":244,"../utils/log.js":250,"global/window":80,"safe-json-parse/tuple":76}],233:[function(a,b,c){"use strict";function d(a){if(a&&a.__esModule)return a;var b={};if(null!=a)for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b[c]=a[c]);return b["default"]=a,b}function e(a){return a&&a.__esModule?a:{"default":a}}function f(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function g(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)}c.__esModule=!0;var h=a("./text-track-cue-list"),i=e(h),j=a("../utils/fn.js"),k=d(j),l=a("./track-enums"),m=a("../utils/log.js"),n=e(m),o=a("global/document"),p=(e(o),a("global/window")),q=e(p),r=a("./track.js"),s=e(r),t=a("../utils/url.js"),u=a("xhr"),v=e(u),w=a("../utils/merge-options"),x=e(w),y=a("../utils/browser.js"),z=d(y),A=function(a,b){var c=new q["default"].WebVTT.Parser(q["default"],q["default"].vttjs,q["default"].WebVTT.StringDecoder()),d=[];c.oncue=function(a){b.addCue(a)},c.onparsingerror=function(a){d.push(a)},c.onflush=function(){b.trigger({type:"loadeddata",target:b})},c.parse(a),d.length>0&&(console.groupCollapsed,d.forEach(function(a){return n["default"].error(a)}),console.groupEnd),c.flush()},B=function(a,b,c){var d={uri:a},e=t.isCrossOrigin(a);e&&(d.withCredentials=c),v["default"](d,k.bind(this,function(a,c,d){return a?n["default"].error(a,c):(b.loaded_=!0,void("function"!=typeof q["default"].WebVTT?b.tech_&&!function(){var a=function(){return A(d,b)};b.tech_.on("vttjsloaded",a),b.tech_.on("vttjserror",function(){n["default"].error("vttjs failed to load, stopping trying to process "+b.src),b.tech_.off("vttjsloaded",a)})}():A(d,b)))}))},C=function(a){function b(){var c=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];if(f(this,b),!c.tech)throw new Error("A tech was not provided.");var d=x["default"](c,{kind:l.TextTrackKind[c.kind]||"subtitles",language:c.language||c.srclang||""}),e=l.TextTrackMode[d.mode]||"disabled",g=d["default"];("metadata"===d.kind||"chapters"===d.kind)&&(e="hidden");var h=a.call(this,d);if(h.tech_=d.tech,z.IS_IE8)for(var j in b.prototype)"constructor"!==j&&(h[j]=b.prototype[j]);h.cues_=[],h.activeCues_=[];var m=new i["default"](h.cues_),n=new i["default"](h.activeCues_),o=!1,p=k.bind(h,function(){this.activeCues,o&&(this.trigger("cuechange"),o=!1)});return"disabled"!==e&&h.tech_.on("timeupdate",p),Object.defineProperty(h,"default",{get:function(){return g},set:function(){}}),Object.defineProperty(h,"mode",{get:function(){return e},set:function(a){l.TextTrackMode[a]&&(e=a,"showing"===e&&this.tech_.on("timeupdate",p),this.trigger("modechange"))}}),Object.defineProperty(h,"cues",{get:function(){return this.loaded_?m:null},set:function(){}}),Object.defineProperty(h,"activeCues",{get:function(){if(!this.loaded_)return null;if(0===this.cues.length)return n;for(var a=this.tech_.currentAbsoluteTime()||this.tech_.currentTime(),b=[],c=0,d=this.cues.length;d>c;c++){var e=this.cues[c];e.startTime<=a&&e.endTime>=a?b.push(e):e.startTime===e.endTime&&e.startTime<=a&&e.startTime+.5>=a&&b.push(e)}if(o=!1,b.length!==this.activeCues_.length)o=!0;else for(var c=0;cc;c++){var e=this.cues_[c];e===a&&(this.cues_.splice(c,1),b=!0)}b&&this.cues.setCues_(this.cues_)},b}(s["default"]);C.prototype.allowedEvents_={cuechange:"cuechange"},c["default"]=C,b.exports=c["default"]},{"../utils/browser.js":239,"../utils/fn.js":244,"../utils/log.js":250,"../utils/merge-options":251,"../utils/url.js":256,"./text-track-cue-list":228,"./track-enums":234,"./track.js":236,"global/document":79,"global/window":80,xhr:85}],234:[function(a,b,c){"use strict";c.__esModule=!0;var d={alternative:"alternative",captions:"captions",main:"main",sign:"sign",subtitles:"subtitles",commentary:"commentary"},e={alternative:"alternative",descriptions:"descriptions",main:"main","main-desc":"main-desc",translation:"translation",commentary:"commentary"},f={subtitles:"subtitles",captions:"captions",descriptions:"descriptions",chapters:"chapters",metadata:"metadata"},g={disabled:"disabled",hidden:"hidden",showing:"showing"};c["default"]={VideoTrackKind:d,AudioTrackKind:e,TextTrackKind:f,TextTrackMode:g},b.exports=c["default"]},{}],235:[function(a,b,c){"use strict";function d(a){if(a&&a.__esModule)return a;var b={};if(null!=a)for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b[c]=a[c]);return b["default"]=a,b}function e(a){return a&&a.__esModule?a:{"default":a}}function f(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function g(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)}c.__esModule=!0;var h=a("../event-target"),i=e(h),j=a("../utils/fn.js"),k=(d(j),a("../utils/browser.js")),l=d(k),m=a("global/document"),n=e(m),o=function(a){function b(){var c=arguments.length<=0||void 0===arguments[0]?[]:arguments[0],d=arguments.length<=1||void 0===arguments[1]?null:arguments[1];if(f(this,b),a.call(this),!d&&(d=this,l.IS_IE8)){d=n["default"].createElement("custom");for(var e in b.prototype)"constructor"!==e&&(d[e]=b.prototype[e])}d.tracks_=[],Object.defineProperty(d,"length",{get:function(){return this.tracks_.length}});for(var g=0;gc;c++)if(this[c]===a){b=this[c],b.off&&b.off(),this.tracks_.splice(c,1);break}b&&this.trigger({track:b,type:"removetrack"})},b.prototype.getTrackById=function(a){for(var b=null,c=0,d=this.length;d>c;c++){var e=this[c];if(e.id===a){b=e;break}}return b},b}(i["default"]);o.prototype.allowedEvents_={change:"change",addtrack:"addtrack",removetrack:"removetrack"};for(var p in o.prototype.allowedEvents_)o.prototype["on"+p]=null;c["default"]=o,b.exports=c["default"]},{"../event-target":201,"../utils/browser.js":239,"../utils/fn.js":244,"global/document":79}],236:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a){if(a&&a.__esModule)return a;var b={};if(null!=a)for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b[c]=a[c]);return b["default"]=a,b}function f(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function g(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)}c.__esModule=!0;var h=a("../utils/browser.js"),i=e(h),j=a("global/document"),k=d(j),l=a("../utils/guid.js"),m=e(l),n=a("../event-target"),o=d(n),p=function(a){function b(){var c=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];f(this,b),a.call(this);var d=this;if(i.IS_IE8){d=k["default"].createElement("custom");for(var e in b.prototype)"constructor"!==e&&(d[e]=b.prototype[e])}var g={id:c.id||"vjs_track_"+m.newGUID(),kind:c.kind||"",label:c.label||"",language:c.language||""},h=function(a){Object.defineProperty(d,a,{get:function(){return g[a]},set:function(){}})};for(var j in g)h(j);return d}return g(b,a),b}(o["default"]);c["default"]=p,b.exports=c["default"]},{"../event-target":201,"../utils/browser.js":239,"../utils/guid.js":247,"global/document":79}],237:[function(a,b,c){"use strict";function d(a){if(a&&a.__esModule)return a;var b={};if(null!=a)for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b[c]=a[c]);return b["default"]=a,b}function e(a){return a&&a.__esModule?a:{"default":a}}function f(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function g(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)}c.__esModule=!0;var h=a("./track-list"),i=e(h),j=a("../utils/browser.js"),k=d(j),l=a("global/document"),m=e(l),n=function(a,b){for(var c=0;c=0;e--)if(c[e].selected){n(c,c[e]);break}if(k.IS_IE8){d=m["default"].createElement("custom");for(var g in i["default"].prototype)"constructor"!==g&&(d[g]=i["default"].prototype[g]);for(var g in b.prototype)"constructor"!==g&&(d[g]=b.prototype[g])}return d=a.call(this,c,d),d.changing_=!1,Object.defineProperty(d,"selectedIndex",{get:function(){for(var a=0;ar;c.IS_OLD_ANDROID=s;var t=q&&5>r&&537>k;c.IS_NATIVE_ANDROID=t;var u=/Edge/i.test(i);c.IS_EDGE=u;var v=!!f["default"].documentMode;c.IS_IE=v;var w=/MSIE\s8\.0/.test(i);c.IS_IE8=w;var x=/MSIE\s9\.0/.test(i);c.IS_IE9=x;var y=!!h["default"].MSInputMethodContext&&!!f["default"].documentMode;c.IS_IE11=y;var z=/IEMobile\/([0-9.]*)/.test(i);c.IS_IEMOBILE=z;var A=function(a){return a&&parseFloat(a[1])}(/MSIE\s(\d+)\.\d/.exec(i));c.IE_VERSION=A;var B=/Firefox/i.test(i);c.IS_FIREFOX=B;var C=function(){var a=i.match(/Firefox\/([0-9.]*)/i);return a&&a[1]?a[1]:void 0}();c.FIREFOX_VERSION=C;var D=!u&&/Chrome/i.test(i);c.IS_CHROME=D;var E=/Safari/i.test(i)&&!D&&!u&&!z;c.IS_SAFARI=E;var F=/Macintosh/i.test(i)&&/AppleWebKit/i.test(i)&&!E&&!B&&!D;c.IS_MACWEBVIEW=F;var G=!!("ontouchstart"in h["default"]||h["default"].DocumentTouch&&f["default"]instanceof h["default"].DocumentTouch);c.TOUCH_ENABLED=G;var H="backgroundSize"in f["default"].createElement("video").style;c.BACKGROUND_SIZE_SUPPORTED=H;var I=/android|webos|windows phone|iphone|ipad|ipod|blackBerry|iemobile|opera mini/i.test(i.toLowerCase());c.IS_MOBILE=I;var J=/MSAppHost/.test(i);c.IS_MSAPPHOST=J},{"global/document":79,"global/window":80}],240:[function(a,b,c){"use strict";function d(a,b){var c,d,f=0;if(!b)return 0;a&&a.length||(a=e.createTimeRange(0,0));for(var g=0;gb&&(d=b),f+=d-c;return f/b}c.__esModule=!0,c.bufferedPercent=d;var e=a("./time-ranges.js")},{"./time-ranges.js":253}],241:[function(a,b,c){"use strict";function d(a){var b=a,c=a.player_.controlBar;c&&Object.getOwnPropertyNames(c).forEach(function(a){c[a]!==b&&c[a].el_&&c[a].el_.className&&(-1!==c[a].el_.className.indexOf("vjs-menu-button")||-1!==c[a].el_.className.indexOf("vjs-volume-control"))&&c[a].buttonPressed_&&c[a].unpressButton()})}c.__esModule=!0,c["default"]=d,b.exports=c["default"]},{}],242:[function(a,b,c){"use strict";function d(a){if(a&&a.__esModule)return a;var b={};if(null!=a)for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b[c]=a[c]);return b["default"]=a,b}function e(a){return a&&a.__esModule?a:{"default":a}}function f(a,b){return a.raw=b,a}function g(a){return"hidden"===M["default"].getComputedStyle(a).visibility?!1:!!(a.offsetWidth||a.offsetHeight||a.getClientRects().length)}function h(a){return"string"==typeof a&&/\S/.test(a)}function i(a){if(/\s/.test(a))throw new Error("class has illegal whitespace characters")}function j(a){return new RegExp("(^|\\s)"+a+"($|\\s)")}function k(a){return function(b,c){return h(b)?(h(c)&&(c=K["default"].querySelector(c)),(C(c)?c:K["default"])[a](b)):K["default"][a](null)}}function l(a){return 0===a.indexOf("#")&&(a=a.slice(1)),K["default"].getElementById(a)}function m(){var a=arguments.length<=0||void 0===arguments[0]?"div":arguments[0],b=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],c=arguments.length<=2||void 0===arguments[2]?{}:arguments[2],d=K["default"].createElement(a);return Object.getOwnPropertyNames(b).forEach(function(a){var c=b[a];-1!==a.indexOf("aria-")||"role"===a||"type"===a?(Q["default"].warn(S["default"](I,a,c)),d.setAttribute(a,c)):d[a]=c}),Object.getOwnPropertyNames(c).forEach(function(a){c[a];d.setAttribute(a,c[a])}),d}function n(a,b){"undefined"==typeof a.textContent?a.innerText=b:a.textContent=b}function o(a,b){b.firstChild?b.insertBefore(a,b.firstChild):b.appendChild(a)}function p(a){var b=a[U];return b||(b=a[U]=O.newGUID()),T[b]||(T[b]={}),T[b]}function q(a){var b=a[U];return b?!!Object.getOwnPropertyNames(T[b]).length:!1}function r(a){var b=a[U];if(b){delete T[b];try{delete a[U]}catch(c){a.removeAttribute?a.removeAttribute(U):a[U]=null}}}function s(a,b){return a.classList?a.classList.contains(b):(i(b),j(b).test(a.className))}function t(a,b){return"undefined"!=typeof b&&null!==b&&b.length>0&&(a.classList?a.classList.add(b):s(a,b)||(a.className=(a.className+" "+b).trim())),a}function u(a,b){return a.classList?a.classList.remove(b):(i(b),a.className=a.className.split(/\s+/).filter(function(a){return a!==b}).join(" ")),a}function v(a,b,c){var d=s(a,b);return"function"==typeof c&&(c=c(a,b)),"boolean"!=typeof c&&(c=!d),c!==d?(c?t(a,b):u(a,b),a):void 0}function w(a,b){Object.getOwnPropertyNames(b).forEach(function(c){var d=b[c];null===d||"undefined"==typeof d||d===!1?a.removeAttribute(c):a.setAttribute(c,d===!0?"":d)})}function x(a){var b,c,d,e,f;if(b={},c=",autoplay,controls,loop,muted,default,",a&&a.attributes&&a.attributes.length>0){d=a.attributes;for(var g=d.length-1;g>=0;g--)e=d[g].name,f=d[g].value,("boolean"==typeof a[e]||-1!==c.indexOf(","+e+","))&&(f=null!==f?!0:!1),b[e]=f}return b}function y(){K["default"].body.focus(),K["default"].onselectstart=function(){return!1}}function z(){K["default"].onselectstart=function(){return!0}}function A(a){var b=void 0;if(a.getBoundingClientRect&&a.parentNode&&(b=a.getBoundingClientRect()),!b)return{left:0,top:0};var c=K["default"].documentElement,d=K["default"].body,e=c.clientLeft||d.clientLeft||0,f=M["default"].pageXOffset||d.scrollLeft,g=c.clientTop||d.clientTop||0,h=M["default"].pageYOffset||d.scrollTop,i=b.top+h-g,j=void 0,k=c.msContentZoomFactor;return j=k&&k>1?b.left-e:b.left+f-e,{left:Math.round(j),top:Math.round(i)}}function B(a,b){var c={},d=A(a),e=a.offsetWidth,f=a.offsetHeight,g=d.top,h=d.left,i=b.pageY,j=b.pageX;return b.changedTouches&&(j=b.changedTouches[0].pageX,i=b.changedTouches[0].pageY),c.y=Math.max(0,Math.min(1,(g-i+f)/f)),c.x=Math.max(0,Math.min(1,(j-h)/e)),c}function C(a){return!!a&&"object"==typeof a&&1===a.nodeType}function D(a){return!!a&&"object"==typeof a&&3===a.nodeType}function E(a){for(;a.firstChild;)a.removeChild(a.firstChild);return a}function F(a){return"function"==typeof a&&(a=a()),(Array.isArray(a)?a:[a]).map(function(a){return"function"==typeof a&&(a=a()),C(a)||D(a)?a:"string"==typeof a&&/\S/.test(a)?K["default"].createTextNode(a):void 0}).filter(function(a){return a})}function G(a,b){return F(b).forEach(function(b){return a.appendChild(b)}),a}function H(a,b){return G(E(a),b)}c.__esModule=!0,c.isVisible=g,c.getEl=l,c.createEl=m,c.textContent=n,c.insertElFirst=o,c.getElData=p,c.hasElData=q,c.removeElData=r,c.hasElClass=s,c.addElClass=t,c.removeElClass=u,c.toggleElClass=v,c.setElAttributes=w,c.getElAttributes=x,c.blockTextSelection=y,c.unblockTextSelection=z,c.findElPosition=A,c.getPointerPosition=B,c.isEl=C,c.isTextNode=D,c.emptyEl=E,c.normalizeContent=F,c.appendContent=G,c.insertContent=H;var I=f(["Setting attributes in the second argument of createEl()\n has been deprecated. Use the third argument instead.\n createEl(type, properties, attributes). Attempting to set "," to ","."],["Setting attributes in the second argument of createEl()\n has been deprecated. Use the third argument instead.\n createEl(type, properties, attributes). Attempting to set "," to ","."]),J=a("global/document"),K=e(J),L=a("global/window"),M=e(L),N=a("./guid.js"),O=d(N),P=a("./log.js"),Q=e(P),R=a("tsml"),S=e(R),T={},U="vdata"+(new Date).getTime(),V=k("querySelector");c.$=V;var W=k("querySelectorAll");c.$$=W},{"./guid.js":247,"./log.js":250,"global/document":79,"global/window":80,tsml:77}],243:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a){if(a&&a.__esModule)return a;var b={};if(null!=a)for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b[c]=a[c]);return b["default"]=a,b}function f(a,b,c){if(Array.isArray(b))return l(f,a,b,c);var d=n.getElData(a);d.handlers||(d.handlers={}),d.handlers[b]||(d.handlers[b]=[]),c.guid||(c.guid=p.newGUID()),d.handlers[b].push(c),d.dispatcher||(d.disabled=!1,d.dispatcher=function(b,c){if(!d.disabled){b=j(b);var e=d.handlers[b.type];if(e)for(var f=e.slice(0),g=0,h=f.length;h>g&&!b.isImmediatePropagationStopped();g++)f[g].call(a,b,c)}}),1===d.handlers[b].length&&(a.addEventListener?a.addEventListener(b,d.dispatcher):a.attachEvent&&a.attachEvent("on"+b,d.dispatcher))}function g(a,b,c){if(n.hasElData(a)){var d=n.getElData(a);if(d.handlers){if(Array.isArray(b))return l(g,a,b,c);var e=function(b){d.handlers[b]=[],k(a,b)};if(b){var f=d.handlers[b];if(f){if(!c)return void e(b);if(c.guid)for(var h=0;ha?0:a;var c=Math.floor(a%60),d=Math.floor(a/60%60),e=Math.floor(a/3600),f=Math.floor(b/60%60),g=Math.floor(b/3600);return(isNaN(a)||a===1/0)&&(e=d=c="-"),e=e>0||g>0?e+":":"",d=((e||f>=10)&&10>d?"0"+d:d)+":",c=10>c?"0"+c:c,e+d+c}()}c.__esModule=!0,c["default"]=d,b.exports=c["default"]},{}],247:[function(a,b,c){"use strict";function d(){return e++}c.__esModule=!0,c.newGUID=d;var e=1},{}],248:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(){var a=void 0,b=void 0;a=g["default"].document.createElement("div"),a.style.color="rgb(31, 41, 59)",g["default"].document.body.appendChild(a),b=g["default"].document.defaultView?g["default"].document.defaultView.getComputedStyle(a,null).color:a.currentStyle.color,b=b.replace(/ /g,""),g["default"].document.body.removeChild(a),String.prototype.includes||(String.prototype.includes=function(){return-1!==String.prototype.indexOf.apply(this,arguments)});var c="rgb(31,41,59)"!==b;c&&!g["default"].document.body.className.includes("high-contrast-enabled")?g["default"].document.body.className=g["default"].document.body.className+" high-contrast-enabled ":c||(g["default"].document.body.className=g["default"].document.body.className.replace("high-contrast-enabled",""))}c.__esModule=!0;var f=a("global/window"),g=d(f);c["default"]=e,b.exports=c["default"]},{"global/window":80}],249:[function(a,b,c){"use strict";function d(){return{ab:{name:"Abkhaz",nativeName:"аҧсуа"},aa:{name:"Afar",nativeName:"Afaraf"},af:{name:"Afrikaans",nativeName:"Afrikaans"},ak:{name:"Akan",nativeName:"Akan"},sq:{name:"Albanian",nativeName:"Shqip"},am:{name:"Amharic",nativeName:"አማርኛ"},ar:{name:"Arabic",nativeName:"العربية" },an:{name:"Aragonese",nativeName:"Aragonés"},hy:{name:"Armenian",nativeName:"Հայերեն"},as:{name:"Assamese",nativeName:"অসমীয়া"},av:{name:"Avaric",nativeName:"авар мацӀ, магӀарул мацӀ"},ae:{name:"Avestan",nativeName:"avesta"},ay:{name:"Aymara",nativeName:"aymar aru"},az:{name:"Azerbaijani",nativeName:"azərbaycan dili"},bm:{name:"Bambara",nativeName:"bamanankan"},ba:{name:"Bashkir",nativeName:"башҡорт теле"},eu:{name:"Basque",nativeName:"euskara, euskera"},be:{name:"Belarusian",nativeName:"Беларуская"},bn:{name:"Bangla",nativeName:"বাংলা"},bh:{name:"Bihari",nativeName:"भोजपुरी"},bi:{name:"Bislama",nativeName:"Bislama"},bs:{name:"Bosnian",nativeName:"bosanski jezik"},br:{name:"Breton",nativeName:"brezhoneg"},bg:{name:"Bulgarian",nativeName:"български език"},my:{name:"Burmese",nativeName:"ဗမာစာ"},ca:{name:"Catalan; Valencian",nativeName:"Català"},ch:{name:"Chamorro",nativeName:"Chamoru"},ce:{name:"Chechen",nativeName:"нохчийн мотт"},ny:{name:"Chichewa; Chewa; Nyanja",nativeName:"chiCheŵa, chinyanja"},zh:{name:"Chinese",nativeName:"中文 (Zhōngwén), 汉语, 漢語"},cv:{name:"Chuvash",nativeName:"чӑваш чӗлхи"},kw:{name:"Cornish",nativeName:"Kernewek"},co:{name:"Corsican",nativeName:"corsu, lingua corsa"},cr:{name:"Cree",nativeName:"ᓀᐦᐃᔭᐍᐏᐣ"},hr:{name:"Croatian",nativeName:"hrvatski"},cs:{name:"Czech",nativeName:"čeština"},da:{name:"Danish",nativeName:"dansk"},dv:{name:"Divehi; Dhivehi; Maldivian;",nativeName:"ދިވެހި"},nl:{name:"Dutch",nativeName:"Nederlands"},en:{name:"English",nativeName:"English"},eo:{name:"Esperanto",nativeName:"Esperanto"},et:{name:"Estonian",nativeName:"eesti"},ee:{name:"Ewe",nativeName:"Eʋegbe"},fo:{name:"Faroese",nativeName:"føroyskt"},fj:{name:"Fijian",nativeName:"vosa Vakaviti"},fi:{name:"Finnish",nativeName:"suomi"},fr:{name:"French",nativeName:"français"},ff:{name:"Fula; Fulah; Pulaar; Pular",nativeName:"Fulfulde, Pulaar, Pular"},gl:{name:"Galician",nativeName:"Galego"},ka:{name:"Georgian",nativeName:"ქართული"},de:{name:"German",nativeName:"Deutsch"},el:{name:"Greek, Modern",nativeName:"Ελληνικά"},gn:{name:"Guaraní",nativeName:"Avañeẽ"},gu:{name:"Gujarati",nativeName:"ગુજરાતી"},ht:{name:"Haitian; Haitian Creole",nativeName:"Kreyòl ayisyen"},ha:{name:"Hausa",nativeName:"Hausa, هَوُسَ"},he:{name:"Hebrew (modern)",nativeName:"עברית"},hz:{name:"Herero",nativeName:"Otjiherero"},hi:{name:"Hindi",nativeName:"हिन्दी, हिंदी"},ho:{name:"Hiri Motu",nativeName:"Hiri Motu"},hu:{name:"Hungarian",nativeName:"Magyar"},ia:{name:"Interlingua",nativeName:"Interlingua"},id:{name:"Indonesian",nativeName:"Bahasa Indonesia"},ie:{name:"Interlingue",nativeName:"Interlingue"},ga:{name:"Irish",nativeName:"Gaeilge"},ig:{name:"Igbo",nativeName:"Asụsụ Igbo"},ik:{name:"Inupiaq",nativeName:"Iñupiaq"},io:{name:"Ido",nativeName:"Ido"},is:{name:"Icelandic",nativeName:"Íslenska"},it:{name:"Italian",nativeName:"Italiano"},iu:{name:"Inuktitut",nativeName:"ᐃᓄᒃᑎᑐᑦ"},ja:{name:"Japanese",nativeName:"日本語"},jv:{name:"Javanese",nativeName:"basa Jawa"},kl:{name:"Kalaallisut, Greenlandic",nativeName:"kalaallisut, kalaallit oqaasii"},kn:{name:"Kannada",nativeName:"ಕನ್ನಡ"},kr:{name:"Kanuri",nativeName:"Kanuri"},ks:{name:"Kashmiri",nativeName:"कश्मीरी, كشميري‎"},kk:{name:"Kazakh",nativeName:"Қазақ тілі"},km:{name:"Khmer",nativeName:"ភាសាខ្មែរ"},ki:{name:"Kikuyu, Gikuyu",nativeName:"Gĩkũyũ"},rw:{name:"Kinyarwanda",nativeName:"Ikinyarwanda"},ky:{name:"Kirghiz, Kyrgyz",nativeName:"кыргыз тили"},kv:{name:"Komi",nativeName:"коми кыв"},kg:{name:"Kongo",nativeName:"KiKongo"},ko:{name:"Korean",nativeName:"한국어 (韓國語), 조선말 (朝鮮語)"},ku:{name:"Kurdish",nativeName:"كوردی‎"},kj:{name:"Kwanyama, Kuanyama",nativeName:"Kuanyama"},la:{name:"Latin",nativeName:"latine"},lb:{name:"Luxembourgish, Letzeburgesch",nativeName:"Lëtzebuergesch"},lg:{name:"Luganda",nativeName:"Luganda"},li:{name:"Limburgish, Limburgan, Limburger",nativeName:"Limburgs"},ln:{name:"Lingala",nativeName:"Lingála"},lo:{name:"Lao",nativeName:"ພາສາລາວ"},lt:{name:"Lithuanian",nativeName:"lietuvių kalba"},lu:{name:"Luba-Katanga",nativeName:""},lv:{name:"Latvian",nativeName:"latviešu valoda"},gv:{name:"Manx",nativeName:"Gaelg, Gailck"},mk:{name:"Macedonian",nativeName:"македонски јазик"},mg:{name:"Malagasy",nativeName:"Malagasy fiteny"},ms:{name:"Malay",nativeName:"bahasa Melayu, بهاس ملايو‎"},ml:{name:"Malayalam",nativeName:"മലയാളം"},mt:{name:"Maltese",nativeName:"Malti"},mi:{name:"Māori",nativeName:"te reo Māori"},mr:{name:"Marathi (Marāṭhī)",nativeName:"मराठी"},mh:{name:"Marshallese",nativeName:"Kajin M̧ajeļ"},mn:{name:"Mongolian",nativeName:"монгол"},na:{name:"Nauru",nativeName:"Ekakairũ Naoero"},nv:{name:"Navajo, Navaho",nativeName:"Diné bizaad, Dinékʼehǰí"},nb:{name:"Norwegian Bokmål",nativeName:"Norsk bokmål"},nd:{name:"North Ndebele",nativeName:"isiNdebele"},ne:{name:"Nepali",nativeName:"नेपाली"},ng:{name:"Ndonga",nativeName:"Owambo"},nn:{name:"Norwegian Nynorsk",nativeName:"Norsk nynorsk"},no:{name:"Norwegian",nativeName:"Norsk"},ii:{name:"Nuosu",nativeName:"ꆈꌠ꒿ Nuosuhxop"},nr:{name:"South Ndebele",nativeName:"isiNdebele"},oc:{name:"Occitan",nativeName:"Occitan"},oj:{name:"Ojibwe, Ojibwa",nativeName:"ᐊᓂᔑᓈᐯᒧᐎᓐ"},cu:{name:"Old Church Slavonic, Church Slavic, Church Slavonic, Old Bulgarian, Old Slavonic",nativeName:"ѩзыкъ словѣньскъ"},om:{name:"Oromo",nativeName:"Afaan Oromoo"},or:{name:"Odia",nativeName:"ଓଡ଼ିଆ"},os:{name:"Ossetian, Ossetic",nativeName:"ирон æвзаг"},pa:{name:"Panjabi, Punjabi",nativeName:"ਪੰਜਾਬੀ, پنجابی‎"},pi:{name:"Pāli",nativeName:"पाऴि"},fa:{name:"Persian",nativeName:"فارسی"},pl:{name:"Polish",nativeName:"polski"},ps:{name:"Pashto, Pushto",nativeName:"پښتو"},pt:{name:"Portuguese",nativeName:"Português"},qu:{name:"Quechua",nativeName:"Runa Simi, Kichwa"},rm:{name:"Romansh",nativeName:"rumantsch grischun"},rn:{name:"Kirundi",nativeName:"kiRundi"},ro:{name:"Romanian, Moldovans, Moldovan",nativeName:"română"},ru:{name:"Russian",nativeName:"русский"},sa:{name:"Sanskrit (Saṁskṛta)",nativeName:"संस्कृतम्"},sc:{name:"Sardinian",nativeName:"sardu"},sd:{name:"Sindhi",nativeName:"सिन्धी, سنڌي، سندھی‎"},se:{name:"Northern Sami",nativeName:"Davvisámegiella"},sm:{name:"Samoan",nativeName:"gagana faa Samoa"},sg:{name:"Sango",nativeName:"yângâ tî sängö"},sr:{name:"Serbian",nativeName:"српски језик"},gd:{name:"Scottish Gaelic; Gaelic",nativeName:"Gàidhlig"},sn:{name:"Shona",nativeName:"chiShona"},si:{name:"Sinhala, Sinhalese",nativeName:"සිංහල"},sk:{name:"Slovak",nativeName:"slovenčina"},sl:{name:"Slovene",nativeName:"slovenščina"},so:{name:"Somali",nativeName:"Soomaaliga, af Soomaali"},st:{name:"Southern Sotho",nativeName:"Sesotho"},es:{name:"Spanish",nativeName:"español"},su:{name:"Sundanese",nativeName:"Basa Sunda"},sw:{name:"Swahili",nativeName:"Kiswahili"},ss:{name:"Swati",nativeName:"SiSwati"},sv:{name:"Swedish",nativeName:"svenska"},ta:{name:"Tamil",nativeName:"தமிழ்"},te:{name:"Telugu",nativeName:"తెలుగు"},tg:{name:"Tajik",nativeName:"تاجیکی‎"},th:{name:"Thai",nativeName:"ไทย"},ti:{name:"Tigrinya",nativeName:"ትግርኛ"},bo:{name:"Tibetan Standard, Tibetan, Central",nativeName:"བོད་ཡིག"},tk:{name:"Turkmen",nativeName:"Türkmen"},tl:{name:"Tagalog",nativeName:"Wikang Tagalog"},tn:{name:"Tswana",nativeName:"Setswana"},to:{name:"Tonga (Tonga Islands)",nativeName:"faka Tonga"},tr:{name:"Turkish",nativeName:"Türkçe"},ts:{name:"Tsonga",nativeName:"Xitsonga"},tt:{name:"Tatar",nativeName:"تاتارچا‎"},tw:{name:"Twi",nativeName:"Twi"},ty:{name:"Tahitian",nativeName:"Reo Tahiti"},ug:{name:"Uighur, Uyghur",nativeName:"ئۇيغۇرچە‎"},uk:{name:"Ukrainian",nativeName:"українська"},ur:{name:"Urdu",nativeName:"اردو"},uz:{name:"Uzbek",nativeName:"zbek, Ўзбек, أۇزبېك‎"},ve:{name:"Venda",nativeName:"Tshivenḓa"},vi:{name:"Vietnamese",nativeName:"Tiếng Việt"},vo:{name:"Volapük",nativeName:"Volapük"},wa:{name:"Walloon",nativeName:"Walon"},cy:{name:"Welsh",nativeName:"Cymraeg"},wo:{name:"Wolof",nativeName:"Wollof"},fy:{name:"Western Frisian",nativeName:"Frysk"},xh:{name:"Xhosa",nativeName:"isiXhosa"},yi:{name:"Yiddish",nativeName:"ייִדיש"},yo:{name:"Yoruba",nativeName:"Yorùbá"},za:{name:"Zhuang, Chuang",nativeName:"Saɯ cueŋƅ, Saw cuengh"},mis:{name:"uncoded languages",nativeName:"uncoded languages"},mul:{name:"multiple languages",nativeName:"multiple languages"},und:{name:"undetermined",nativeName:"undetermined"},zxx:{name:"no linguistic content/not applicable",nativeName:"no linguistic content/not applicable"}}}function e(a){var b={aar:"aa",abk:"ab",ave:"ae",afr:"af",aka:"ak",amh:"am",ara:"ar",asm:"as",ava:"av",aym:"ay",aze:"az",bak:"ba",bel:"be",bul:"bg",bih:"bh",bis:"bi",bam:"bm",ben:"bn",bod:"bo",tib:"bo",bre:"br",bos:"bs",cat:"ca",che:"ce",cha:"ch",cos:"co",cre:"cr",ces:"cs",cze:"cs",chu:"cu",chv:"cv",cym:"cy",wel:"cy",dan:"da",deu:"de",ger:"de",div:"dv",dzo:"dz",ewe:"ee",ell:"el",gre:"el",eng:"en",epo:"eo",spa:"es",est:"et",baq:"eu",eus:"eu",fas:"fa",per:"fa",ful:"ff",fin:"fi",fij:"fj",fao:"fo",fre:"fr",fra:"fr",fry:"fy",gle:"ga",gla:"gd",glg:"gl",grn:"gn",glv:"gv",guj:"gu",hau:"ha",heb:"he",hin:"hi",hmo:"ho",hrv:"hr",hat:"ht",hun:"hu",arm:"hy",hye:"hy",her:"hz",ina:"ia",ind:"id",ile:"ie",ibo:"ig",iii:"ii",ipk:"ik",ido:"io",ice:"is",isl:"is",ita:"it",iku:"iu",jpn:"ja",jav:"jv",geo:"ka",kat:"ka",kon:"kg",kik:"ki",kua:"kj",kaz:"kk",kal:"kl",khm:"km",kan:"kn",kor:"ko",kau:"kr",kas:"ks",kur:"ku",kom:"kv",cor:"kw",kir:"ky",lat:"la",ltz:"lb",lug:"lg",lim:"li",lin:"ln",lao:"lo",lit:"lt",lub:"lu",lav:"lv",mlg:"mg",mah:"mh",mao:"mi",mri:"mi",mac:"mk",mkd:"mk",mal:"ml",mon:"mn",mar:"mr",may:"ms",msa:"ms",mlt:"mt",bur:"my",mya:"my",nau:"na",nob:"nb",nde:"nd",nep:"ne",ndo:"ng",dut:"nl",nld:"nl",nno:"nn",nor:"no",nbl:"nr",nav:"nv",nya:"ny",oci:"oc",oji:"oj",orm:"om",ori:"or",oss:"os",pan:"pa",pli:"pi",pol:"pl",pus:"ps",por:"pt",que:"qu",roh:"rm",run:"rn",ron:"ro",rum:"ro",rus:"ru",kin:"rw",san:"sa",srd:"sc",snd:"sd",sme:"se",sag:"sg",sin:"si",slk:"sk",slo:"sk",slv:"sl",smo:"sm",sna:"sn",som:"so",alb:"sq",sqi:"sq",srp:"sr",ssw:"ss",sot:"st",sun:"su",swe:"sv",swa:"sw",tam:"ta",tel:"te",tgk:"tg",tha:"th",tir:"ti",tuk:"tk",tgl:"tl",tsn:"tn",ton:"to",tur:"tr",tso:"ts",tat:"tt",twi:"tw",tah:"ty",uig:"ug",ukr:"uk",urd:"ur",uzb:"uz",ven:"ve",vie:"vi",vol:"vo",wln:"wa",wol:"wo",xho:"xh",yid:"yi",yor:"yo",zha:"za",chi:"zh",zho:"zh",zul:"zu"};return b[a]}c.__esModule=!0,c.getIsoLangs=d,c.get2LetterLangCode=e},{}],250:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(){for(var a=arguments.length,b=Array(a),c=0;a>c;c++)b[c]=arguments[c];i.logByType("log",b)}c.__esModule=!0;var f=a("global/window"),g=d(f),h=a("./browser"),i={};c.Log=i,i.logByType=function(a,b){var c=arguments.length<=2||void 0===arguments[2]?!!h.IE_VERSION&&h.IE_VERSION<11:arguments[2],d=g["default"].console,f=d&&d[a]||function(){};"log"!==a&&b.unshift(a.toUpperCase()+":"),e.history.push(b),b.unshift("VIDEOJS:"),c&&(b=b.map(function(a){if(a&&"object"==typeof a||Array.isArray(a))try{return JSON.stringify(a)}catch(b){}return String(a)}).join(" ")),f.apply?f[Array.isArray(b)?"apply":"call"](d,b):f(b)},e.history=[],e.error=function(){for(var a=arguments.length,b=Array(a),c=0;a>c;c++)b[c]=arguments[c];return i.logByType("error",b)},e.warn=function(){for(var a=arguments.length,b=Array(a),c=0;a>c;c++)b[c]=arguments[c];return i.logByType("warn",b)},c["default"]=e},{"./browser":239,"global/window":80}],251:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a){return!!a&&"object"==typeof a&&"[object Object]"===a.toString()&&a.constructor===Object}function f(){var a=Array.prototype.slice.call(arguments);return a.unshift({}),a.push(i),h["default"].apply(null,a),a[0]}c.__esModule=!0,c["default"]=f;var g=a("lodash-compat/object/merge"),h=d(g),i=function(a,b){return e(b)?e(a)?void 0:f(b):b};b.exports=c["default"]},{"lodash-compat/object/merge":62}],252:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}c.__esModule=!0;var e=a("global/document"),f=d(e),g=function(a){var b=f["default"].createElement("style");return b.className=a,b};c.createStyleElement=g;var h=function(a,b){a.styleSheet?a.styleSheet.cssText=b:a.textContent=b};c.setTextContent=h},{"global/document":79}],253:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a,b){return Array.isArray(a)?f(a):void 0===a||void 0===b?f():f([[a,b]])}function f(a){return void 0===a||0===a.length?{length:0,start:function(){throw new Error("This TimeRanges object is empty")},end:function(){throw new Error("This TimeRanges object is empty")}}:{length:a.length,start:g.bind(null,"start",0,a),end:g.bind(null,"end",1,a)}}function g(a,b,c,d){return void 0===d&&(j["default"].warn("DEPRECATED: Function '"+a+"' on 'TimeRanges' called without an index argument."),d=0),h(a,d,c.length-1),c[d][b]}function h(a,b,c){if(0>b||b>c)throw new Error("Failed to execute '"+a+"' on 'TimeRanges': The index provided ("+b+") is greater than or equal to the maximum bound ("+c+").")}c.__esModule=!0,c.createTimeRanges=e;var i=a("./log.js"),j=d(i);c.createTimeRange=e},{"./log.js":250}],254:[function(a,b,c){"use strict";function d(a){return a.charAt(0).toLowerCase()+a.slice(1)}c.__esModule=!0,c["default"]=d,b.exports=c["default"]},{}],255:[function(a,b,c){"use strict";function d(a){return a.charAt(0).toUpperCase()+a.slice(1)}c.__esModule=!0,c["default"]=d,b.exports=c["default"]},{}],256:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}c.__esModule=!0;var e=a("global/document"),f=d(e),g=a("global/window"),h=d(g),i=function(a){var b=["protocol","hostname","port","pathname","search","hash","host"];a=encodeURI(a);var c=f["default"].createElement("a");c.href=a;var d=""===c.host&&"file:"!==c.protocol,e=void 0;d&&(e=f["default"].createElement("div"),e.innerHTML='',c=e.firstChild,e.setAttribute("style","display:none; position:absolute;"),f["default"].body.appendChild(e));for(var g={},h=0;hx',a=c.firstChild.href}return a};c.getAbsoluteURL=n;var o=function(a){if("string"==typeof a){var b=/^(\/?)([\s\S]*?)((?:\.{1,2}|[^\/]+?)(\.([^\.\/\?]+)))(?:[\/]*|[\?].*)$/i,c=b.exec(a);if(c)return c.pop().toLowerCase()}return""};c.getFileExtension=o;var p=function(a){var b=h["default"].location,c=i(a),d=":"===c.protocol?b.protocol:c.protocol,e=d+c.host!==b.protocol+b.host;return e};c.isCrossOrigin=p},{"global/document":79,"global/window":80}],257:[function(a,b,c){"use strict";function d(a){if(a&&a.__esModule)return a;var b={};if(null!=a)for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b[c]=a[c]);return b["default"]=a,b}function e(a){return a&&a.__esModule?a:{"default":a}}function f(a,b,c){var d=void 0;if("string"==typeof a){if(0===a.indexOf("#")&&(a=a.slice(1)),f.getPlayers()[a])return b&&M["default"].warn('Player "'+a+'" is already initialised. Options will not be applied.'),c&&f.getPlayers()[a].ready(c),f.getPlayers()[a];d=O.getEl(a)}else d=a;if(!d||!d.nodeName)throw new TypeError("The element or ID supplied is not valid. (videojs)");return d.player||v["default"].players[d.playerId]||new v["default"](d,b,c)}c.__esModule=!0;{var g=a("global/window"),h=e(g),i=a("global/document"),j=e(i),k=a("./setup"),l=d(k),m=a("./utils/stylesheet.js"),n=d(m),o=a("./component"),p=e(o),q=a("./event-target"),r=e(q),s=a("./utils/events.js"),t=d(s),u=a("./player"),v=e(u),w=a("./plugins.js"),x=e(w),y=a("../../src/js/utils/merge-options.js"),z=e(y),A=a("./utils/fn.js"),B=d(A),C=a("./tracks/text-track.js"),D=e(C),E=a("./tracks/audio-track.js"),F=e(E),G=a("./tracks/video-track.js"),H=e(G),I=a("./utils/time-ranges.js"),J=a("./utils/format-time.js"),K=e(J),L=a("./utils/log.js"),M=e(L),N=a("./utils/dom.js"),O=d(N),P=a("./utils/browser.js"),Q=d(P),R=a("./utils/url.js"),S=d(R),T=a("./extend.js"),U=e(T),V=a("lodash-compat/object/merge"),W=e(V),X=a("xhr"),Y=e(X),Z=a("./tech/tech.js"),$=e(Z),_=a("./tech/html5.js"),aa=(e(_),a("./tech/flash.js"));e(aa)}if("undefined"==typeof HTMLVideoElement&&(j["default"].createElement("video"),j["default"].createElement("audio"),j["default"].createElement("track")),h["default"].VIDEOJS_NO_DYNAMIC_STYLE!==!0){var ba=O.$(".vjs-styles-defaults");if(!ba){ba=n.createStyleElement("vjs-styles-defaults");var ca=O.$("head");ca.insertBefore(ba,ca.firstChild),n.setTextContent(ba,"\n .video-js {\n width: 300px;\n height: 150px;\n }\n\n .vjs-fluid {\n padding-top: 56.25%\n }\n ")}}l.autoSetupTimeout(1,f),f.VERSION="2.1.8.0",f.options=v["default"].prototype.options_,f.getPlayers=function(){return v["default"].players},f.players=v["default"].players,f.getComponent=p["default"].getComponent,f.registerComponent=function(a,b){$["default"].isTech(b)&&M["default"].warn("The "+a+" tech was registered as a component. It should instead be registered using videojs.registerTech(name, tech)"),p["default"].registerComponent.call(p["default"],a,b)},f.getTech=$["default"].getTech,f.registerTech=$["default"].registerTech,f.browser=Q,f.TOUCH_ENABLED=Q.TOUCH_ENABLED,f.extend=U["default"],f.mergeOptions=z["default"],f.bind=B.bind,f.plugin=x["default"],f.addLanguage=function(a,b){var c;return a=(""+a).toLowerCase(),v["default"].prototype.options_.languagesMutated=!0,W["default"](f.options.languages,(c={},c[a]=b,c))[a]},f.log=M["default"],f.createTimeRange=f.createTimeRanges=I.createTimeRanges,f.formatTime=K["default"],f.parseUrl=S.parseUrl,f.isCrossOrigin=S.isCrossOrigin,f.EventTarget=r["default"],f.on=t.on,f.one=t.one,f.off=t.off,f.trigger=t.trigger,f.xhr=Y["default"],f.TextTrack=D["default"],f.AudioTrack=F["default"],f.VideoTrack=H["default"],f.isEl=O.isEl,f.isTextNode=O.isTextNode,f.createEl=O.createEl,f.hasClass=O.hasElClass,f.addClass=O.addElClass,f.removeClass=O.removeElClass,f.toggleClass=O.toggleElClass,f.setAttributes=O.setElAttributes,f.getAttributes=O.getElAttributes,f.emptyEl=O.emptyEl,f.appendContent=O.appendContent,f.insertContent=O.insertContent,"object"==typeof c&&"object"==typeof b&&(b.exports=f),c["default"]=f,b.exports=c["default"]},{"../../src/js/utils/merge-options.js":251,"./component":163,"./event-target":201,"./extend.js":202,"./player":210,"./plugins.js":211,"./setup":215,"./tech/flash.js":218,"./tech/html5.js":219,"./tech/tech.js":222,"./tracks/audio-track.js":225,"./tracks/text-track.js":233,"./tracks/video-track.js":238,"./utils/browser.js":239,"./utils/dom.js":242,"./utils/events.js":243,"./utils/fn.js":244,"./utils/format-time.js":246,"./utils/log.js":250,"./utils/stylesheet.js":252,"./utils/time-ranges.js":253,"./utils/url.js":256,"global/document":79,"global/window":80,"lodash-compat/object/merge":62,xhr:85}]},{},[96]),amp.utils=amp.utils||{},amp.utils.getBitrateByUnit=function(a){var b=a+"bps";return a>=1e6?(a=amp.utils.roundToOneDecimal(a/1e6),b=a+"Mbps"):a>=1e3&&(a=amp.utils.roundToOneDecimal(a/1e3),b=a+"Kbps"),b},amp.utils.getSizeByUnit=function(a){var b=a;return a>=1048576?(a=amp.utils.roundToOneDecimal(a/1048576),b=a+"MB"):a>=1024&&(a=amp.utils.roundToOneDecimal(a/1024),b=a+"KB"),b},amp.utils.roundToOneDecimal=function(a){return+(Math.round(a+"e+1")+"e-1")},function(a){"use strict";var b=amp.getComponent("MenuButton"),c=b.prototype.addChild;b.prototype.addChild=function(b){c.call(this,b),b.hasClass("vjs-menu")&&this.trigger(a.internalEventName.menuadded)}}(window.amp),function(a){"use strict";a.plugin("responsive",function(b){function c(a){return"number"==typeof a?a:"string"!=typeof a||isNaN(parseInt(a,10))?!1:parseInt(a,10)}function d(a){for(var b={},d=Object.keys(a),e=0;e=f&&g>=a&&b.push(d):void 0!==f&&a>=f?b.push(d):void 0!==g&&g>=a&&b.push(d)}b.length>0&&(b=b.join(" "),i!==b&&(this.removeElClass(this.playerContainer(),i),this.addElClass(this.playerContainer(),b),i=b)),e(this)}function h(){for(var a=j.el().offsetHeight-j.controlBar.el().offsetHeight,b=a-20,c=0;ce||(c!==d&&f.switchIndex(e)&&(cc&&(g[c]=h[c]+" ("+c+")",g[b]=h[b]+" ("+b+")")})}for(var d=0;d-1)return!0;return!1}function o(a,b){var c=[];return a.forEach(function(a,d){c.push(b(a,d))}),c}var p=this,q=a.getIsoLangs(),r=b&&b.menuTitle?b.menuTitle:"Audio Tracks",s=b&&b.selectedItem?b.selectedItem:0,t="amp-audiotracks-control",u=this.htmlEncode(this.localize("Dolby Digital")),v=this.htmlEncode(this.localize("Stereo")),w={},x={},y=!0,z=!1;p.options_.skinConfig&&p.options_.skinConfig.audioTracksMenu&&("undefined"!=typeof p.options_.skinConfig.audioTracksMenu.enabled&&(y=p.options_.skinConfig.audioTracksMenu.enabled),z=p.options_.skinConfig.audioTracksMenu.useManifestForLabel||!1);var A=a.getComponent("MenuItem");a.AudioTrackskMenuItem=a.extend(A,{init:function(a,b){var c={label:b.text,selected:b.selected,selectable:!0};A.call(this,a,c),this.addClass("amp-menu-item")}}),a.AudioTrackskMenuItem.prototype.handleClick=function(){c(this)},a.registerComponent("AudioTrackskMenuItem",a.AudioTrackskMenuItem);var B=a.getComponent("MenuButton");a.AudioTracksButton=a.extend(B,{init:function(b,c){y&&(c=c||{},c.name="audioTracksButton",B.call(this,b,c),b.addEventListener(AzureHtml5JS.Common.isSafari?a.eventName.loadeddata:a.eventName.loadedmetadata,a.bind(this,g)))}}),a.AudioTracksButton.prototype.refresh=function(){if(this.removeChild(this.menu),null!=this.menu&&this.menu.dispose(),this.menu=this.createMenu(),!this.items||this.items.length<=1)return void this.hide();this.addChild(this.menu);var b=a.getComponent("Component"),c=new b(p,{el:a.createEl("li",{className:"amp-menu-header",innerHTML:this.htmlEncode(this.localize(r)),tabindex:-1})});this.menu.prependItem(c),this.show()},a.AudioTracksButton.prototype.buttonText=r,a.AudioTracksButton.prototype.createItems=function(){var b=d(this.player_)||[],c=!0,f=null,g=[];AzureHtml5JS.Common.isChromiumEdge&&(c=this.player_&&this.player_.tech_&&this.player_.tech_.mediaPlayer&&this.player_.tech_.mediaPlayer._sessionContext&&this.player_.tech_.mediaPlayer._sessionContext.emeManager&&this.player_.tech_.mediaPlayer._sessionContext.emeManager.matchedKeySystem?!0:!1),c&&(f=e(this.player_));for(var h=0,i=0;h=0&&c.currentTime()>0&&(e=AMP.Misc.formatString(c.localize("AD_TIMING_INFO"),h),g.length>0&&(e=c.htmlEncode(e)+' | '+c.htmlEncode(g)+""),b=e),d="amp-logo-ad"}else b=c.htmlEncode(b);var i=null;i=a?['
','

'+c.htmlEncode(a)+"

",'
',"
"]:['
','
','
',"
"];var j=null;b&&(j='
'+b+"
");var k=i.join("");return null!=j&&(k+=j),k}function d(){var b=c(this.title_||this.options_.title,this.options_.description,this);if(void 0!==e.contentTitleElement){e.contentTitleElement.innerHTML=b;var d=e.options().logo?!!e.options().logo.enabled:!0,g=f?"amp-logo-ad":"amp-logo";if(d&&e.el().getElementsByClassName(g).length>0){var h=new a.Logo(e);e.el().getElementsByClassName(g)[0].appendChild(h.el()),e.on("dispose",function(){h.dispose()})}}}var e=this,f=e.options_.isAdPlayer||!1,g=a.bind(e,d);e.ready(function(){var d=c(b.title,b.description,e),g="";g=f?a.createEl("div",{className:"amp-content-title-ad",innerHTML:d}):a.createEl("div",{className:"amp-content-title",innerHTML:d}),e.contentTitleElement=e.el().appendChild(g),f&&(e.contentTitleElement.onclick=function(){e.trigger("tech-click")})}),e.on("firstplay",g),e.on("presentationUpdate",g),f&&e.on("timeupdate",g),e.on("dispose",function(){e.contentTitleElement&&(e.contentTitleElement.parentElement&&e.contentTitleElement.parentElement.removeChild(e.contentTitleElement),e.contentTitleElement=null)})})}(window.amp),function(a){"use strict";a.plugin("wallClockOverlay",function(){function b(){var a=c.getWallClockTime(null,d.useLocalTimeZone,d.timezone,d.controlBar12HourFormat,!1),b=['
','

'+this.htmlEncode(a)+"

","
"];c.overlayElement&&(c.overlayElement.innerHTML=b.join(""))}var c=this,d=c.options_.wallClockTimeDisplaySettings,e=d?d.enabled:!1,f=a.bind(c,b);c.ready(function(){if(e){var b=a.createEl("div",{className:"amp-wall-clock-overlay",innerHTML:""});c.overlayElement=c.el().appendChild(b)}}),e&&c.on("timeupdate",f),c.on("dispose",function(){c.overlayElement&&(c.overlayElement.parentElement&&c.overlayElement.parentElement.removeChild(c.overlayElement),c.overlayElement=null)})})}(window.amp),function(a){"use strict";a.plugin("controlBarIcons",function(b){function c(a){for(var b=0;b0&&this.show(),h&&0===this.languageCount&&this.closeCallback&&this.closeCallback()},c.prototype.show=function(){this.visible||(this.dialogElement||this.createDialogElement(),this.dialogElement.style.display="block",this.visible=!0,this.dialogElement.focus())},c.prototype.createDialogElement=function(){var b,c,d,e,f,g=this,h=this.playerElement.id,i=h+"_dlclose",j=h+"_dl",k=h+"_sel",l=h+"_dlglbl",m=h+"_dlgdesc";this.dialogElement=document.createElement("div"),this.dialogElement.style.display="none",this.dialogElement.className="amp-download-dialog",this.dialogElement.tabIndex=-1,this.dialogElement.setAttribute("role","dialog"),this.dialogElement.setAttribute("aria-labelledby",l),this.dialogElement.setAttribute("aria-describedby",m),this.dialogElement.onkeydown=function(a){27==a.keyCode&&g.hide()},c=this.dialogElement.appendChild(document.createElement("div")),c.setAttribute("role","document"),d=c.appendChild(document.createElement("div")),d.id=l,d.className="vjs-control-text",d.setAttribute("role","heading"),d.setAttribute("aria-level","1"),d.innerText=this.player.localize("Media Download Dialog"),e=c.appendChild(document.createElement("div")),e.id=m,e.className="vjs-control-text",e.innerText=this.player.localize("Media Download Description"),f=c.appendChild(document.createElement("div")),f.className="outline-enabled",f.innerHTML="
"+this.player.localize("Close")+"
"+this.player.localize("Download")+"
";var n=this.dialogElement.getElementsByTagName("form")[0],o=this.dialogElement.getElementsByTagName("select")[0];for(b in this.languagesInFiles)if(this.languagesInFiles.hasOwnProperty(b)){var p=this.languagesInFiles[b],q=document.createElement("option");q.value=b,q.innerText=p.languageName.nativeName,o.add(q)}o.selectedIndex=0,o.onchange=function(){g.refreshMediaList(n,o)},this.refreshMediaList(n,o),this.playerElement.appendChild(this.dialogElement),document.getElementById(i).onclick=function(){g.hide()},this.downloadButton=document.getElementById(j),this.downloadButton.onclick=function(){g.selectedFile&&a.Logger.verbose(5,"Download plugin: Starting download file: "+g.selectedFile.uri)}},c.prototype.removeDialogElement=function(){this.dialogElement&&(this.playerElement.removeChild(this.dialogElement),this.dialogElement=null),this.visible=!1},c.prototype.refreshMediaList=function(a,b){var c,d,e,f=this;for(this.unselectFile();a.firstChild;)a.removeChild(a.firstChild);if(b.selectedIndex>=0&&b[b.selectedIndex]&&(d=b[b.selectedIndex],e=this.languagesInFiles[d.value]))for(c=0;c0;b.controlBar.downloadButton.dialog&&b.controlBar.downloadButton.dialog.options(a),c?b.addClass("amp-showing-download-control"):b.removeClass("amp-showing-download-control")};b.addEventListener("downloadableMediaChanged",e),e()})}return a}();!function(a,b){amp.plugin("download",function(){new d(b,this)})}(window,window.amp)}(a.Plugins||(a.Plugins={}));a.Plugins}(AMP||(AMP={})),function(a){"use strict";a.plugin("live",function(b){function c(){f(),w.currentTime(w.duration()),F=!1}function d(){w.isLive()?(G="LowLatency"===w.currentHeuristicProfile()&&"AzureHtml5JS"===w.currentTechName(),G&&(D=0,F=!1,B=C,w.addEventListener(amp.internalEventName.currentTimeChanging,k)),w.addEventListener(a.eventName.seeked,l),w.addEventListener(a.eventName.seeking,l),w.addEventListener(a.eventName.timeupdate,j),u(),o()):(w.removeEventListener(a.eventName.seeked,l),w.removeEventListener(a.eventName.seeking,l),w.removeEventListener(a.eventName.timeupdate,j),t(),v()),G||(B=A,w.removeEventListener(amp.internalEventName.currentTimeChanging,k))}function e(){"Html5"==w.currentTechName()&&w.isLive()&&(u(),o())}function f(){w.canControlPlaybackRate()&&w.playbackRate()>1&&h()}function g(){w.canControlPlaybackRate()&&w.playbackRate()<1&&h()}function h(){w.playbackRate(1),H=!0,I=1,K=!1,L=!1,M=!1,w.one(a.eventName.timeupdate,l)}function i(){w.canControlPlaybackRate()&&I!==w.playbackRate()&&(H=!1,F=!0)}function j(){if(w.isLive()){var b=m();b?(t(),q(),G&&setTimeout(function(){!w.paused()&&!F&&Date.now()-D>E&&(AMP.Logger.warning(AMP.Logger.Area.plugin,"amplive plugin: player drifted from live edge. Attempting to move to live edge.."),D=0,c())},50),!H&&n()&&g()):(G&&0==D&&(D=Date.now()),H||f())}else w.removeEventListener(a.eventName.seeked,l),w.removeEventListener(a.eventName.seeking,l),w.removeEventListener(a.eventName.timeupdate,j),t(),v()}function k(a,b){b.time'}).firstChild.href,b=(amp.browser.IS_FIREFOX||amp.browser.IS_IE11||amp.browser.IS_EDGE)&&h?a.createEl("span",{innerHTML:''}):a.createEl("span",{innerHTML:''})}else b=(amp.browser.IS_FIREFOX||amp.browser.IS_IE11||amp.browser.IS_EDGE)&&h?a.createEl("div",{innerHTML:''}):a.createEl("div");return b.style.opacity=d,this.container=b,b},a.registerComponent("Logo",a.Logo),this.ready(function(){var b=this;if(c&&b.el().getElementsByClassName(g).length>0){var d=new a.Logo(b);b.el().getElementsByClassName(g)[0].appendChild(d.el()),b.on("dispose",function(){d.dispose()})}})})}(window.amp),function(a){"use strict";a.plugin("moreOptions",function(b){function c(a,b){if(t=b,b){for(var c=0;c1?(a.addThrottledWindowResizeListener(function(){g(a)},r),g(a)):c(a,!1)}function g(a){if(0==a.controlBar.width())c(a,a.width()b)}}var h,i=a.getComponent("Component"),j=this,k=0,l=b&&b.controls?b.controls:[],m=b&&b.menuTitle?b.menuTitle:"More Options",n="amp-moreoptions-control",o=[],p=[],q=Date.now(),r=200,s=null,t=!1,u=a.getComponent("MenuItem");a.MoreOptionsMenuItem=a.extend(u,{init:function(a,b){var c={label:b.text,value:b.value,selected:b.selected};u.call(this,a,c),this.control=b.control,this.addClass("amp-menu-item"),b.className.split(" ").forEach(function(a){this.addClass(a)},this),this.control.menu&&this.control.menu.on("mouseleave",function(){this.el().style.display=""})}}),a.MoreOptionsMenuItem.prototype.handleClick=function(){this.control.handleClick(),q=Date.now()},a.registerComponent("MoreOptionsMenuItem",a.MoreOptionsMenuItem);var v=a.getComponent("MenuButton");a.MoreOptionsButton=a.extend(v,{init:function(b,c){if(c=c||{},c.name="moreOptionsButton",v.call(this,b,c),b.addEventListener(amp.eventName.loadedmetadata,a.bind(this,function(){this.refresh()})),this.on("mouseover",function(){d(b)}),this.items.length>0){var e=new i(b,{el:a.createEl("li",{className:"amp-menu-header",innerHTML:this.htmlEncode(this.localize(m)),tabindex:-1})});this.menu.prependItem(e)}this.el().tabIndex=-1,this.addClass("amp-control-disabled"),this.el().setAttribute("aria-hidden","true"),this.el().setAttribute("aria-label","More Options"),this.el().setAttribute("title",this.localize("More Options")),this.el().setAttribute("role","region")}}),a.MoreOptionsButton.prototype.buttonText=m,a.MoreOptionsButton.prototype.createItems=function(){for(var b=e(this.player_)||[],c=[],d=0;d0){var b=new i(this.player_,{el:a.createEl("li",{className:"amp-menu-header",innerHTML:this.htmlEncode(this.localize(m)),tabindex:-1})});this.menu.prependItem(b)}},a.MoreOptionsButton.prototype.hasJustBeenClicked=function(){return Date.now()-q<500},a.MoreOptionsButton.prototype.onClick=function(a){this.hasJustBeenClicked()||v.prototype.onClick.call(this,a)},a.MoreOptionsButton.prototype.isSubMenuVisible=function(){var a=this,b=this.player_.controlBar;if(b)for(var c=Object.getOwnPropertyNames(b),d=0;d=0&&k720?4:720>=c&&c>480?3:480>=c&&c>360?2:1}var e=a.el().className.match(/quality-\d/);a.el().className=a.el().className.replace(e,"quality-"+d)}function f(){this.refresh(),g(this.player_)}function g(b){var c=b.currentVideoStreamList();if(c&&c.streams)for(var d=0;d1?0:d.length-f,i!==k&&(k0){var d=a.getComponent("Component"),e=new d(b,{el:a.createEl("li",{className:"amp-menu-header",innerHTML:this.htmlEncode(this.localize(j)),tabindex:-1})});this.menu.prependItem(e),this.el().className+=" quality-"+(4-k)}else this.hide()}}),a.QualityButton.prototype.buttonText=j,a.QualityButton.prototype.createItems=function(){for(var b=d(this.player_)||[],c=[],e=0;e0){var b=a.getComponent("Component"),c=new b(i,{el:a.createEl("li",{className:"amp-menu-header",innerHTML:this.htmlEncode(this.localize(j)),tabindex:-1})});this.menu.prependItem(c),null==this.el().className.match(/quality-\d/)&&(this.el().className+=" quality-"+(4-k)),this.show()}else this.hide()}})}(window.amp),function(a){"use strict";a.plugin("subtitles",function(b){var c=this,d=b&&b.menuTitle?b.menuTitle:"Subtitles",e=b&&b.offMenuItemLabel?b.offMenuItemLabel:"Off";c.addEventListener(amp.eventName.loadedmetadata,function(){c.controlBar.subtitlesButton.el().className+=" amp-subtitles-control",c.controlBar.subtitlesButton.menu.children()[0].el().innerHTML=this.htmlEncode(this.localize(e)),c.controlBar.subtitlesButton.buttonText=d;var b=a.getComponent("Component"),f=new b(c,{el:a.createEl("li",{className:"amp-menu-header",innerHTML:this.htmlEncode(this.localize(d)),tabindex:-1})});c.controlBar.subtitlesButton.menu.prependItem(f)})})}(window.amp),function(a){"use strict";a.plugin("outline",function(a){function b(a){a.clientX&&0!==a.clientX&&a.clientY&&0!==a.clientY&&i.removeClass(n)}function c(a){a.classList.add(o),a.removeEventListener("click",b),a.addEventListener("click",b),i.on("dispose",function(){a.removeEventListener("click",b)})}function d(){for(var a=i.el().querySelectorAll(k),b=0;b0&&(j=f.duration(),d(),e(),f.isLive()&&g&&g.length>0&&setTimeout(c,1e3))}function d(){for(var a=0;a0?b.time:0,e=b.color?b.color:h;l.call(this,a,videojs.mergeOptions({el:m.prototype.createEl.call(this,"div",{innerHTML:" ",className:i})},b)),d=a.currentTime()+d-a.currentMediaTime();var f=d/c*100;f>0&&100>f&&(this.el_.style.left=d/c*100+"%",this.el_.style.backgroundColor=e,this.on("click",this.onClick))}}),a.Marker.prototype.onClick=function(){this.player().currentTime(this.options().time)},f.ready(function(){g&&(c(),f.on("sourceset",function(){g=[],d()}),f.on("midrollAdded",function(){if(this.scheduler){var a=this.scheduler.getMidRolls();if(a){g=[];for(var b=0;b'+c+""}"off"===this.ampVolumeMenuButton.el_.getAttribute("aria-live")&&this.ampVolumeMenuButton.el_.setAttribute("aria-live","polite")},a.VolumeControl.prototype.createVolumeSliderHandle=function(){var b=a.getComponent("Component"),c=b.prototype.createEl.call(this,"div",{className:"vjs-volume-handle vjs-control"});return c},a.registerComponent("AmpVolumeMenuButton",a.AmpVolumeMenuButton),a.registerComponent("VolumeControl",a.VolumeControl),c.ready(function(){var b=new a.VolumeControl(c,{});c.controlBar.volumeControl=c.controlBar.addChild(b);var f=c.controlBar.volumeControl,g=function(){isNaN(d)||(clearTimeout(d),d=0/0)};e&&(c.on("userinactive",function(){f.popUp&&f.volumeBar.el_===document.activeElement&&(g(),d=setTimeout(function(){f.volumeBar.el_!==document.activeElement||c.userActive()||f.ampVolumeMenuButton.el().focus()},1e3)),f.el_.setAttribute("aria-expanded","false")}),c.on("useractive",g)),f.updateVolumeHandle(),this.one(c,"timeupdate",function(){f.volumeBar.update(),f.updateVolumeHandle()})})})}(window.amp),function(a){"use strict";a.plugin("playbackSpeed",function(b){function c(){v.sort(function(a,b){return b.value-a.value})}function d(){for(var a=0;a=.5&&v[B].value<=4&&a(v[B].value)&&w.push({selected:!1,name:v[B].name,value:v[B].value})}function g(){f(function(a){return 1>=a})}function h(){f(function(a){return a>=1})}function i(){d(),c(),e()}function j(a,b){b.canControlPlaybackRate()&&b.playbackRate(a)}function k(a){var b=a.controlBar.playbackSpeedButton.currentSpeedIndex||0===a.controlBar.playbackSpeedButton.currentSpeedIndex?w[a.controlBar.playbackSpeedButton.currentSpeedIndex].value:1;a.controlBar.playbackSpeedButton.removeClass(y),a.controlBar.playbackSpeedButton.removeClass(z),a.controlBar.playbackSpeedButton.removeClass(A),a.controlBar.playbackSpeedButton.addClass(b>1?z:1>b?A:y)}function l(a,b,c,d){var e=c||a.player_,f=e.controlBar.playbackSpeedButton,g=e.controlBar.playbackSpeedButton.currentSpeedIndex,h=o(b||a.options().value);null===h||!d&&g===h||(m(f),f.items[h].selected(!0),n(f,h),j(w[h].value,e),e.controlBar.playbackSpeedButton.currentSpeedIndex=h,k(e))}function m(a){for(var b=0;b47&&59>d||d>95&&106>d)&&(D||!(a.metaKey||a.ctrlKey||a.altKey))&&A){var g=48;d>95&&(g=96);var h=d-g;e(),j.currentTime(j.duration()*h*.1)}for(var i in b.customKeys){var m=b.customKeys[i];m&&m.key&&m.handler&&m.key(a)&&(e(),m.handler(j,b))}}}},H=function(a){if(j.controls()){var b=a.relatedTarget||a.toElement||l.activeElement;(b==k||b==k.querySelector(".vjs-tech")||b==k.querySelector(".iframeblocker"))&&z&&(j.isFullscreen()?j.exitFullscreen():j.requestFullscreen())}},I=function(a){if(j.controls()){var b=a.relatedTarget||a.toElement||l.activeElement;if((C||b==k||b==k.querySelector(".vjs-tech")||b==k.querySelector(".iframeblocker")||b==k.querySelector(".vjs-control-bar"))&&y){a=window.event||a;var c=Math.max(-1,Math.min(1,a.wheelDelta||-a.detail));a.preventDefault?a.preventDefault():a.returnValue=!1,1==c?j.volume(j.volume()+v):-1==c&&j.volume(j.volume()-v)}}},J=function(a,c){return b.playPauseKey(a,c)?n:b.rewindKey(a,c)?o:b.forwardKey(a,c)?p:b.volumeUpKey(a,c)?q:b.volumeDownKey(a,c)?r:b.muteKey(a,c)?s:b.fullscreenKey(a,c)?t:void 0};return j.on("keydown",G),j.on("dblclick",H),j.on("mousewheel",I),j.on("DOMMouseScroll",I),this};a.plugin("hotKeys",b)}(window.videojs),amp.AmpInlinePlugins=amp.extend(amp.getComponent("Component"),{init:function(a,b){"use strict";var c={hotKeys:{},ampAds:{}};Object.getOwnPropertyNames(c).forEach(function(d){if(a[d]){var e=c[d];b&&b.playerOptions&&b.playerOptions[d]&&(e=b.playerOptions[d]),a[d](e)}})}}),amp.registerComponent("AmpInlinePlugins",amp.AmpInlinePlugins),amp.getComponent("Player").prototype.options_.children.push("AmpInlinePlugins"),!function(a){var b;"undefined"!=typeof window?b=window:"undefined"!=typeof global?b=global:"undefined"!=typeof self&&(b=self),b.ADSVAST=a()}(function(){return function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);throw new Error("Cannot find module '"+g+"'")}var j=c[g]={exports:{}};b[g][0].call(j.exports,function(a){var c=b[g][1][a];return e(c?c:a)},j,j.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;ga||isNaN(a))throw TypeError("n must be a positive number");return this._maxListeners=a,this},c.prototype.emit=function(a){var b,c,e,h,i,j;if(this._events||(this._events={}),"error"===a&&(!this._events.error||f(this._events.error)&&!this._events.error.length))throw b=arguments[1],b instanceof Error?b:TypeError('Uncaught, unspecified "error" event.');if(c=this._events[a],g(c))return!1;if(d(c))switch(arguments.length){case 1:c.call(this);break;case 2:c.call(this,arguments[1]);break;case 3:c.call(this,arguments[1],arguments[2]);break;default:for(e=arguments.length,h=new Array(e-1),i=1;e>i;i++)h[i-1]=arguments[i];c.apply(this,h)}else if(f(c)){for(e=arguments.length,h=new Array(e-1),i=1;e>i;i++)h[i-1]=arguments[i];for(j=c.slice(),e=j.length,i=0;e>i;i++)j[i].apply(this,h)}return!0},c.prototype.addListener=function(a,b){var e;if(!d(b))throw TypeError("listener must be a function");if(this._events||(this._events={}),this._events.newListener&&this.emit("newListener",a,d(b.listener)?b.listener:b),this._events[a]?f(this._events[a])?this._events[a].push(b):this._events[a]=[this._events[a],b]:this._events[a]=b,f(this._events[a])&&!this._events[a].warned){var e;e=g(this._maxListeners)?c.defaultMaxListeners:this._maxListeners,e&&e>0&&this._events[a].length>e&&(this._events[a].warned=!0)}return this},c.prototype.on=c.prototype.addListener,c.prototype.once=function(a,b){function c(){this.removeListener(a,c),e||(e=!0,b.apply(this,arguments))}if(!d(b))throw TypeError("listener must be a function");var e=!1;return c.listener=b,this.on(a,c),this},c.prototype.removeListener=function(a,b){var c,e,g,h;if(!d(b))throw TypeError("listener must be a function");if(!this._events||!this._events[a])return this;if(c=this._events[a],g=c.length,e=-1,c===b||d(c.listener)&&c.listener===b)delete this._events[a],this._events.removeListener&&this.emit("removeListener",a,b);else if(f(c)){for(h=g;h-->0;)if(c[h]===b||c[h].listener&&c[h].listener===b){e=h;break}if(0>e)return this;1===c.length?(c.length=0,delete this._events[a]):c.splice(e,1),this._events.removeListener&&this.emit("removeListener",a,b)}return this},c.prototype.removeAllListeners=function(a){var b,c;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[a]&&delete this._events[a],this;if(0===arguments.length){for(b in this._events)"removeListener"!==b&&this.removeAllListeners(b);return this.removeAllListeners("removeListener"),this._events={},this}if(c=this._events[a],d(c))this.removeListener(a,c);else for(;c.length;)this.removeListener(a,c[c.length-1]);return delete this._events[a],this},c.prototype.listeners=function(a){var b;return b=this._events&&this._events[a]?d(this._events[a])?[this._events[a]]:this._events[a].slice():[]},c.listenerCount=function(a,b){var c;return c=a._events&&a._events[b]?d(a._events[b])?1:a._events[b].length:0}},{}],2:[function(a,b){var c;c=function(){function a(){this.errorURLTemplates=[],this.impressionURLTemplates=[],this.creatives=[],this.adTitle=""}return a}(),b.exports=c},{}],3:[function(a,b){var c,d,e;d=a("./parser.coffee"),e=a("./util.coffee"),c=function(){function a(){}return a.cappingFreeLunch=0,a.cappingMinimumTimeInterval=0,a.timeout=0,a.get=function(a,b,c){var e;return e=+new Date,this.totalCallsTimeout=this.totalCalls?void b(null):e-this.lastSuccessfullAdb;b++)if(b in this&&this[b]===a)return b;return-1};c=a("./urlhandler.coffee"),j=a("./response.coffee"),d=a("./ad.coffee"),k=a("./util.coffee"),g=a("./creative.coffee").VASTCreativeLinear,f=a("./creative.coffee").VASTCreativeCompanion,h=a("./mediafile.coffee"),e=a("./companionad.coffee"),i=function(){function a(){}var b;return b=[],a.addURLTemplateFilter=function(a){"function"==typeof a&&b.push(a)},a.removeURLTemplateFilter=function(){return b.pop()},a.countURLTemplateFilters=function(){return b.length},a.clearUrlTemplateFilters=function(){return b=[]},a.parse=function(a,b,c){return this._parse(a,null,function(a,c){return b(c)},c)},a._parse=function(a,d,e,f){var g,h,i;for(h=0,i=b.length;i>h;h++)g=b[h],a=g(a);return null==d&&(d=[]),d.push(a),c.get(a,function(b){return function(c,f){var g,h,i,m,n,o,p,q,r,s,t;if(null!=c)return e(c);if(n=new j,null==(null!=f?f.documentElement:void 0)||"VAST"!==f.documentElement.nodeName)return e();for(s=f.documentElement.childNodes,o=0,q=s.length;q>o;o++)m=s[o],"Error"===m.nodeName&&n.errorURLTemplates.push(b.parseNodeText(m));for(t=f.documentElement.childNodes,p=0,r=t.length;r>p;p++)m=t[p],"Ad"===m.nodeName&&(g=b.parseAdElement(m),null!=g?n.ads.push(g):(AMP.Logger.error(AMP.Logger.Area.plugin,"Ads plugin: Ad element parsing failed."),k.track(n.errorURLTemplates,{ERRORCODE:101})));for(h=function(){var a,b,c;if(n){for(c=n.ads,a=0,b=c.length;b>a;a++)if(g=c[a],null!=g.nextWrapperURL)return;return 0===n.ads.length&&(AMP.Logger.error(AMP.Logger.Area.plugin,"Ads plugin: No Ads."),k.track(n.errorURLTemplates,{ERRORCODE:303}),n=null),e(null,n)}},i=n.ads.length;i--;)g=n.ads[i],null!=g.nextWrapperURL&&!function(c){var e,f;return d.length>=10||(f=c.nextWrapperURL,l.call(d,f)>=0)?(AMP.Logger.error(AMP.Logger.Area.plugin,"Ads plugin: Reached maximum wrapper length of 10 and no Ads found."),k.track(c.errorURLTemplates,{ERRORCODE:302}),n.ads.splice(n.ads.indexOf(c),1),void h()):(-1===c.nextWrapperURL.indexOf("://")&&(e=a.slice(0,a.lastIndexOf("/")),c.nextWrapperURL=""+e+"/"+c.nextWrapperURL),b._parse(c.nextWrapperURL,d,function(a,b){var d,e,f,g,i,j,l,m,o,p,q,r,s,t;if(null!=a)AMP.Logger.error(AMP.Logger.Area.plugin,"Ads plugin: Wrapper URi fetch timeout."),k.track(c.errorURLTemplates,{ERRORCODE:301}),n.ads.splice(n.ads.indexOf(c),1);else if(null==b)AMP.Logger.error(AMP.Logger.Area.plugin,"Ads plugin: No wrapped response."),k.track(c.errorURLTemplates,{ERRORCODE:303}),n.ads.splice(n.ads.indexOf(c),1);else for(n.errorURLTemplates=n.errorURLTemplates.concat(b.errorURLTemplates),f=n.ads.indexOf(c),n.ads.splice(f,1),r=b.ads,j=0,l=r.length;l>j;j++){if(g=r[j],g.errorURLTemplates=c.errorURLTemplates.concat(g.errorURLTemplates),g.impressionURLTemplates=c.impressionURLTemplates.concat(g.impressionURLTemplates),null!=c.trackingEvents)for(s=g.creatives,p=0,m=s.length;m>p;p++)for(d=s[p],t=Object.keys(c.trackingEvents),q=0,o=t.length;o>q;q++)e=t[q],d.trackingEvents=d.trackingEvents||{},(i=d.trackingEvents)[e]||(i[e]=[]),d.trackingEvents[e]=d.trackingEvents[e].concat(c.trackingEvents[e]);n.ads.splice(f,0,g)}return delete c.nextWrapperURL,h()}))}(g);return h()}}(this),f)},a.childByName=function(a,b){var c,d,e,f;for(f=a.childNodes,d=0,e=f.length;e>d;d++)if(c=f[d],c.nodeName===b)return c},a.childsByName=function(a,b){var c,d,e,f,g;for(d=[],g=a.childNodes,e=0,f=g.length;f>e;e++)c=g[e],c.nodeName===b&&d.push(c);return d},a.parseAdElement=function(a){var b,c,d,e;for(e=a.childNodes,c=0,d=e.length;d>c;c++){if(b=e[c],"Wrapper"===b.nodeName)return this.parseWrapperElement(b);if("InLine"===b.nodeName)return this.parseInLineElement(b)}},a.parseWrapperElement=function(a){var b,c,d;return b=this.parseInLineElement(a),d=this.childByName(a,"VASTAdTagURI"),null!=d&&(b.nextWrapperURL=this.parseNodeText(d)),c=b.creatives[0],null!=c&&null!=c.trackingEvents&&(b.trackingEvents=c.trackingEvents),null!=b.nextWrapperURL?b:void 0},a.parseInLineElement=function(a){var b,c,e,f,g,h,i,j,k,l,m,n,o,p;for(b=new d,n=a.childNodes,h=0,k=n.length;k>h;h++)switch(g=n[h],g.nodeName){case"AdTitle":b.adTitle=this.parseNodeText(g);break;case"Error":b.errorURLTemplates.push(this.parseNodeText(g));break;case"Impression":b.impressionURLTemplates.push(this.parseNodeText(g));break;case"Creatives":for(o=this.childsByName(g,"Creative"),i=0,l=o.length;l>i;i++)for(e=o[i],p=e.childNodes,j=0,m=p.length;m>j;j++)switch(f=p[j],f.nodeName){case"Linear":c=this.parseCreativeLinearElement(f),c&&b.creatives.push(c);break;case"CompanionAds":c=this.parseCompanionAd(f),c&&b.creatives.push(c)}}return b},a.parseCreativeLinearElement=function(a){var b,c,d,e,f,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A;if(b=new g,b.duration=this.parseDuration(this.parseNodeText(this.childByName(a,"Duration"))),-1===b.duration&&"Wrapper"!==a.parentNode.parentNode.parentNode.nodeName)return null;for(j=a.getAttribute("skipoffset"),null==j?b.skipDelay=null:"%"===j.charAt(j.length-1)?(i=parseInt(j,10),b.skipDelay=b.duration*(i/100)):b.skipDelay=this.parseDuration(j),n=this.childByName(a,"VideoClicks"),null!=n&&(b.videoClickThroughURLTemplate=this.parseNodeText(this.childByName(n,"ClickThrough")),b.videoClickTrackingURLTemplate=this.parseNodeText(this.childByName(n,"ClickTracking"))),x=this.childsByName(a,"TrackingEvents"),p=0,t=x.length;t>p;p++)for(l=x[p],y=this.childsByName(l,"Tracking"),q=0,u=y.length;u>q;q++)if(k=y[q],c=k.getAttribute("event"),m=this.parseNodeText(k),null!=c&&null!=m)if("progress"===c){var B=k.getAttribute("offset");if(-1!==B.indexOf("%"))B=B.trim().substring(0,B.indexOf("%"));else if(B=B.trim().split(":"),4==B.length||3==B.length){var C=B[0],D=B[1],E=B[2];B=3600*C+60*D+E,B=B/b.duration*100}B=parseInt(B),c=c+"-"+B,null==(o=b.trackingEvents)[c]&&(o[c]=[]),b.trackingEvents[c].push(m),b.progressOffsets.push(B)}else null==(o=b.trackingEvents)[c]&&(o[c]=[]),b.trackingEvents[c].push(m);for(z=this.childsByName(a,"MediaFiles"),r=0,v=z.length;v>r;r++)for(f=z[r],A=this.childsByName(f,"MediaFile"),s=0,w=A.length;w>s;s++)e=A[s],d=new h,d.fileURL=this.parseNodeText(e),d.deliveryType=e.getAttribute("delivery"),d.codec=e.getAttribute("codec"),d.mimeType=e.getAttribute("type"),d.bitrate=parseInt(e.getAttribute("bitrate")||0),d.minBitrate=parseInt(e.getAttribute("minBitrate")||0),d.maxBitrate=parseInt(e.getAttribute("maxBitrate")||0),d.width=parseInt(e.getAttribute("width")||0),d.height=parseInt(e.getAttribute("height")||0),b.mediaFiles.push(d);return b},a.parseCompanionAd=function(a){var b,c,d,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x;for(d=new f,u=this.childsByName(a,"Companion"),m=0,q=u.length;q>m;m++){for(c=u[m],b=new e,b.id=c.getAttribute("id")||null,b.width=c.getAttribute("width"),b.height=c.getAttribute("height"),v=this.childsByName(c,"StaticResource"),n=0,r=v.length;r>n;n++)h=v[n],b.type=h.getAttribute("creativeType")||0,b.staticResource=this.parseNodeText(h);for(w=this.childsByName(c,"TrackingEvents"),o=0,s=w.length;s>o;o++)for(j=w[o],x=this.childsByName(j,"Tracking"),p=0,t=x.length;t>p;p++)i=x[p],g=i.getAttribute("event"),k=this.parseNodeText(i),null!=g&&null!=k&&(null==(l=b.trackingEvents)[g]&&(l[g]=[]),b.trackingEvents[g].push(k));b.companionClickThroughURLTemplate=this.parseNodeText(this.childByName(c,"CompanionClickThrough")),d.variations.push(b)}return d},a.parseDuration=function(a){var b,c,d,e,f;return null==a?-1:(b=a.split(":"),3!==b.length?-1:(f=b[2].split("."),e=parseInt(f[0]),2===f.length&&(e+=parseFloat("0."+f[1])),d=parseInt(60*b[1]),c=parseInt(60*b[0]*60),isNaN(c||isNaN(d||isNaN(e||d>3600||e>60)))?-1:c+d+e))},a.parseNodeText=function(a){return a&&(a.textContent||a.text)},a}(),b.exports=i},{"./ad.coffee":2,"./companionad.coffee":4,"./creative.coffee":5,"./mediafile.coffee":7,"./response.coffee":9,"./urlhandler.coffee":11,"./util.coffee":14}],9:[function(a,b){var c;c=function(){function a(){this.ads=[],this.errorURLTemplates=[]}return a}(),b.exports=c},{}],10:[function(a,b){var c,d,e,f,g,h={}.hasOwnProperty,i=function(a,b){function c(){this.constructor=a}for(var d in b)h.call(b,d)&&(a[d]=b[d]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a};d=a("./client.coffee"),g=a("./util.coffee"),e=a("./creative.coffee").VASTCreativeLinear,c=a("events").EventEmitter,f=function(a){function b(a,b){var c,f,g;if(this.ad=a,this.creative=b,this.muted=!1,this.impressed=!1,this.skipable=!1,this.skipDelayDefault=-1,this.trackingEvents={},this.progressOffsets=[],this.emitAlwaysEvents=["creativeView","start","firstQuartile","midpoint","thirdQuartile","complete","rewind","skip","mute","unmute","pause","rewind","resume","fullscreen","exitFullscreen","closeLinear","close","skip","click","progress"],b){g=b.trackingEvents;for(c in g)f=g[c],this.trackingEvents[c]=f.slice(0);this.progressOffsets=b.progressOffsets||[],this.progressOffsets.sort(function(a,b){return a-b})}b instanceof e?(this.assetDuration=b.duration,this.quartiles={firstQuartile:Math.round(25*this.assetDuration)/100,midpoint:Math.round(50*this.assetDuration)/100,thirdQuartile:Math.round(75*this.assetDuration)/100},this.skipDelay=b.skipDelay,this.linear=!0,this.clickThroughURLTemplate=b.videoClickThroughURLTemplate,this.clickTrackingURLTemplate=b.videoClickTrackingURLTemplate):(this.skipDelay=-1,this.linear=!1),this.on("start",function(){d.lastSuccessfullAd=+new Date})}return i(b,a),b.prototype.resetTrackingEventsInfo=function(){if(this.creative){var a,b,c=this.creative.trackingEvents;for(a in c)b=c[a],this.trackingEvents[a]=b.slice(0);this.impressed=!1}},b.prototype.setProgress=function(a){var b,c,d,e,f,g,h,i,j;if(f=null===this.skipDelay?this.skipDelayDefault:this.skipDelay,-1===f||this.skipable||(f>a?this.emit("skip-countdown",f-a):(this.skipable=!0,this.emit("skip-countdown",0))),this.linear&&this.assetDuration>0){if(c=[],a>0){if(c.push("start"),d=Math.round(a/this.assetDuration*100),this.progressOffsets.length>0)for(var k=this.progressOffsets.length-1;k>=0;k--)if(this.progressOffsets[k]<=d){c.push("progress-"+this.progressOffsets[k]);break}j=this.quartiles;for(e in j)g=j[e],a>=g&&g+1>=a&&c.push(e)}for(h=0,i=c.length;i>h;h++)b=c[h],this.track(b,!0);a-1&&this.emitAlwaysEvents.splice(c,1))},b.prototype.trackURLs=function(a,b){return null==b&&(b={}),this.linear&&(b.CONTENTPLAYHEAD=this.progressFormated(),b.ASSETURI=this.assetFileUri),g.track(a,b)},b.prototype.progressFormated=function(){var a,b,c,d,e;return e=parseInt(this.progress),a=e/3600,a.length<2&&(a="0"+a),b=e/60%60,b.length<2&&(b="0"+b),d=e%60,d.length<2&&(d="0"+b),c=parseInt(100*(this.progress-e)),""+a+":"+b+":"+d+"."+c},b}(c),b.exports=f},{"./client.coffee":3,"./creative.coffee":5,"./util.coffee":14,events:1}],11:[function(a,b){var c,d,e;e=a("./urlhandlers/xmlhttprequest.coffee"),d=a("./urlhandlers/flash.coffee"),c=function(){function b(){}return b.get=function(b,c,f){return"undefined"==typeof window||null===window?a("./urlhandlers/node.coffee").get(b,c):e.supported()?e.get(b,c,f):d.supported()?d.get(b,c):c()},b}(),b.exports=c},{"./urlhandlers/flash.coffee":12,"./urlhandlers/xmlhttprequest.coffee":13}],12:[function(a,b){var c;c=function(){function a(){}return a.xdr=function(){var a;return window.XDomainRequest&&(a=new XDomainRequest),a},a.supported=function(){return!!this.xdr()},a.get=function(a,b){function c(){return b(null,null)}var d,e;return(e="function"==typeof window.ActiveXObject?new window.ActiveXObject("Microsoft.XMLDOM"):void 0)?(e.async=!1,d=this.xdr(),d.open("GET",a),d.send(),d.onerror=c,d.ontimeout=c,d.onload=function(){return e.loadXML(d.responseText),b(null,e)}):b()},a}(),b.exports=c},{}],13:[function(a,b){var c;c=function(){function a(){}return a.xhr=function(){var a;return a=new window.XMLHttpRequest,"withCredentials"in a?a:void 0},a.supported=function(){return!!this.xhr()},a.get=function(a,b,c){function d(){return b(null,null)}var e;return e=this.xhr(),e.open("GET",a),e.timeout=c,e.ontimeout=d,e.onerror=d,e.send(),e.onreadystatechange=function(){return 4===e.readyState?b(null,e.responseXML):void 0}},a}(),b.exports=c},{}],14:[function(a,b){var c;c=function(){function a(){}return a.track=function(a,b){var c,d,e,f,g,h;for(d=this.resolveURLTemplates(a,b),h=[],f=0,g=d.length;g>f;f++)c=d[f],"undefined"!=typeof window&&null!==window&&(e=new Image,h.push(e.src=c));return h},a.resolveURLTemplates=function(a,b){var c,d,e,f,g,h,i,j,k;d=[],null==b&&(b={}),"CACHEBUSTING"in b||(b.CACHEBUSTING=Math.round(1e10*Math.random())),b.random=b.CACHEBUSTING;for(j=0,k=a.length;k>j;j++)if(c=a[j],h=c){for(e in b)i=b[e],f="["+e+"]",g="%%"+e+"%%",h=h.replace(f,i),h=h.replace(g,i);d.push(h)}return d},a.storage=function(){var a,b,c,d;try{c="undefined"!=typeof window&&null!==window?window.localStorage||window.sessionStorage:null}catch(e){d=e,c=null}return b=function(a){var b,c;try{if(c="__VASTUtil__",a.setItem(c,c),a.getItem(c)!==c)return!0}catch(d){return b=d,!0}return!1},(null==c||b(c))&&(a={},c={length:0,getItem:function(b){return a[b]},setItem:function(b,c){a[b]=c,this.length=Object.keys(a).length},removeItem:function(b){delete a[b],this.length=Object.keys(a).length},clear:function(){a={},this.length=0}}),c}(),a}(),b.exports=c},{}]},{},[6])(6)});var AMP;!function(a){!function(b){!function(b){"use strict";var c=function(){function a(){}return a.creativeView="creativeView",a.start="start",a.firstQuartile="firstQuartile",a.midpoint="midpoint",a.thirdQuartile="thirdQuartile",a.complete="complete",a.mute="mute",a.unmute="unmute",a.pause="pause",a.rewind="rewind",a.resume="resume",a.fullscreen="fullscreen",a.exitFullscreen="exitFullscreen",a.expand="expand",a.collapse="collapse",a.acceptInvitationLinear="acceptInvitationLinear",a.closeLinear="closeLinear",a.skip="skip",a.progress="progress",a.click="click",a.error="error",a}();b.TrackingEvents=c;var d=function(){function a(){}return a.XML_PARSING_ERROR=100,a.VAST_SCHEMA_VALIDATION_ERROR=101,a.VAST_VERSION_OF_RESPONSE_NOT_SUPPORTED=102,a.TRAFFICKING_ERROR=200,a.VIDE0_PLAYER_EXPECTED_DIFFERENT_LINEARITY=201,a.VIDE0_PLAYER_EXPECTED_DIFFERENT_DURATION=202,a.VIDE0_PLAYER_EXPECTED_DIFFERENT_SIZE=203,a.GENERAL_RESPONSE_ERROR=300,a.TIMEOUT_OF_URI_PROVIDED_IN_WRAPPER=301,a.WRAPPER_LIMIT_REACHED=302,a.NO_ADS_RESPONSE_AFTER_WRAPPERS=303,a.GENERAL_LINEAR_ERROR=400,a.TIMEOUT_MEDIA_URI=402,a.NO_MEDIA_FILE_SUPPORTED=403,a.PROBLEM_PLAYING_MEDIA_FILE=405,a.UNDEFINED_ERROR=900,a}();b.VastErrorsCodes=d;var e=function(){function b(){}return b.prototype.get=function(b,c,d){var e=this,f=window.ADSVAST.client;a.Logger.verbose(5,"Ads plugin: Fetching ads"),f.get(b,function(b){a.Logger.verbose(5,"Ads plugin: Ads fetch response VastFile = "+JSON.stringify(b)),null!=b?(a.Logger.verbose(5,"Ads plugin: Ads Fetched"),e.addTrackerForCreatives(b),c.call(e,b)):(a.Logger.verbose(5,"Ads plugin: Failed to fetch the ads"),c.call(e))},d)},b.prototype.addTrackerForCreatives=function(a){for(var b=0;bf.mediaFiles[h].bitrate&&f.mediaFiles[h].bitrate>=this.requestedBitrate&&(i=f.mediaFiles[h]):i=f.mediaFiles[h]);null===i&&(a.Logger.error(5,"Ads plugin: No supported Media file can be found."),f.tracker.errorWithCode(a.ads.vast.VastErrorsCodes.NO_MEDIA_FILE_SUPPORTED))}if(null!==f&&null!=i){i.fileURL=i.fileURL.trim(),f.tracker.setAssetFileUri(i.fileURL);var k=new d({src:i.fileURL,type:i.mimeType},null,c.ads[0].adTitle),l=new e(c.ads[0].adTitle,k,0,!0);return this.strictSchedule&&(l.timedReturn=!0),f.videoClickThroughURLTemplate&&f.videoClickThroughURLTemplate.length>0&&(l.clickThrough=f.videoClickThroughURLTemplate),b.options&&b.options.skipAd&&b.options.skipAd.enabled&&(l.skippable=b.options.skipAd.offset),l.ad=c,l.isAd=!0,this.adTrackerInfo.push(new g(l,c,f)),l}return b===this.preRoll?this.preRollFetchFailed=!0:b===this.postRoll&&(this.postRollFetchFailed=!0),null},b.prototype.getTrackerMapInfoForClip=function(a){for(var b=0;b=0&&(this.midRolls[a].splice={id:-1,startOffset:this.midRolls[a].startTime},this.fetchAdForAdElement(this.midRolls[a]))},b.prototype.handlePlayerEvent=function(b){switch(b.type){case amp.eventName.disposing:break;case amp.eventName.loadeddata:var c=b.clip;c&&!c.isAd&&this.fetchAllStaticMidRolls();break;case amp.eventName.splicewaiting:var d=this.player.spliceWaiting();d.sort(function(a,b){return a.startOffset-b.startOffset});for(var e=0;eb.startTime&&(c=1),c},b.prototype.handleTimeUpdateAndFetchMidRoll=function(a){var c=b.binarySearchThroughMidRolls(a,this.midRolls,this.compareAdStartTime);-1!==c&&-1!==this.adsFetched.indexOf(this.midRolls[c])&&this.fetchAdForAdElement(this.midRolls[c])},b.prototype.processPresentationLayout=function(a){var b=this;if(null!==a&&void 0!==a){var c=!1;if(a.preRoll){if(!a.preRoll.sourceUri)throw"preRoll without sourceUri is not valid";this.preRoll=a.preRoll,c=!0}if(a.midRoll&&a.midRoll.length>0)for(var d=0;d1&&this.midRolls.sort(function(a,b){return a.startTime-b.startTime}),this.strictSchedule=!!a.strictSchedule,c&&(this.player.showBusy(),this.player.ready(function(){b.addListenersForPlayerEvents()}),this.init())}},b.prototype.mapAmpEventNameToVastEventName=function(b){switch(b){case amp.eventName.playing:return a.ads.vast.TrackingEvents.creativeView;case amp.eventName.errorInPlayingAd:return a.ads.vast.TrackingEvents.error;case amp.eventName.start:return a.ads.vast.TrackingEvents.start;case amp.eventName.firstquartile:return a.ads.vast.TrackingEvents.progress;case amp.eventName.midpoint:return a.ads.vast.TrackingEvents.progress;case amp.eventName.thirdquartile:return a.ads.vast.TrackingEvents.progress;case amp.eventName.complete:return a.ads.vast.TrackingEvents.complete;case amp.eventName.mute:return a.ads.vast.TrackingEvents.mute;case amp.eventName.unmute:return a.ads.vast.TrackingEvents.unmute;case amp.eventName.resume:return a.ads.vast.TrackingEvents.resume;case amp.eventName.fullscreen:return a.ads.vast.TrackingEvents.fullscreen;case amp.eventName.exitfullscreen:return a.ads.vast.TrackingEvents.exitFullscreen;case amp.eventName.click:return a.ads.vast.TrackingEvents.click;case amp.eventName.skip:return a.ads.vast.TrackingEvents.skip;case amp.eventName.pause:return a.ads.vast.TrackingEvents.pause;case amp.eventName.resume:return a.ads.vast.TrackingEvents.resume;case amp.eventName.rewind:return a.ads.vast.TrackingEvents.rewind;case amp.eventName.timeupdate:return a.ads.vast.TrackingEvents.progress}return null},b.DefaultTimeoutVal=5e3,b.binarySearchThroughMidRolls=AzureHtml5JS.Common.binarySearch,b}()}(a.ads||(a.ads={}));a.ads}(AMP||(AMP={}));var AMP;!function(a){!function(b){"use strict";function c(a){return new d(a)}b.createScheduler=c;var d=function(){function b(b){var c=this;this._eventsToRoute=[amp.eventName.canplaythrough,amp.eventName.timeupdate,amp.eventName.start,amp.eventName.firstquartile,amp.eventName.midpoint,amp.eventName.thirdquartile,amp.eventName.ended,amp.eventName.mute,amp.eventName.unmute,amp.eventName.rewind,amp.eventName.resume,amp.eventName.pause,amp.eventName.fullscreen,amp.eventName.exitfullscreen,amp.eventName.click,amp.eventName.skip,amp.eventName.error,amp.eventName.play,amp.eventName.playing],this._player=b,this._adPlaybackStrategy=a.Scheduler.Strategy.getStrategy(this._player),this._midRolls=[],this._currentClipIndexInPlayList=-1,this.addListenersForAllPlayerEvents(),this._currentPreloadPlayIndexInMidRolls=-1,this._lastMidRollPlayed=null,this._lastMainContentTime=-1,this._adPlayMonitorTimerId=0/0,this._nextClipPreloaded=!1,this._adPlayStartTime=0/0,this._playList=null,this._player.addEventListener("presentationUpdate",function(){null!==c._playList&&c._adPlaybackStrategy.updateAutoPlay(!0),c.reset(),c._adPlaybackStrategy.presentationUpdated()})}return b.prototype.setPlaylist=function(a){var b=this;this._playList=a,this.startPlaybackWithNextInPlayList(),this._player.one(amp.eventName.play,function(){b.handleFirstPlay(b._player)})},b.prototype.playlist=function(){return this._playList},b.prototype.reset=function(){this._midRolls=[],this._currentClipIndexInPlayList=-1,this._currentPreloadPlayIndexInMidRolls=-1,this._lastMidRollPlayed=null,this._lastMainContentTime=-1,this._nextClipPreloaded=!1,this._adPlayStartTime=0/0,this.stopAdPlayTimer(),this._playList=null},b.prototype.dispose=function(){this.stopRoutingAdEvents(),this._adPlaybackStrategy&&this._adPlaybackStrategy.dispose(),this.stopAdPlayTimer()},b.prototype.startPlaybackWithNextInPlayList=function(){if(this._currentClipIndexInPlayList++,this._playList.clips.length>0&&this._currentClipIndexInPlayListb)return;var c=this._playList.clips[a];for(a+=1;c.isAd&&b-1>a;)c=this._playList.clips[a++];if(!c.isAd)return this._adPlaybackStrategy.setMainContent(c),void this._adPlaybackStrategy.preloadMainContent()}},b.prototype.addListenersForAllPlayerEvents=function(){var a=this._adPlaybackStrategy.getAdPlayer();this._player!==a&&(this.startRoutingAdEvents(a),this.addEventListeners(a)),this.addEventListeners(this._player)},b.prototype.addEventListeners=function(a){var b=this;a.addEventListener(amp.eventName.timeupdate,function(){b.playerTimeUpdate(a)}),a.addEventListener(amp.eventName.seeked,function(){b.playerSeeked(a)}),a.addEventListener(amp.eventName.ended,function(){b.handleEnded(a)})},b.prototype.startRoutingAdEvents=function(a){var b=this;this._eventsToRoute.forEach(function(c){a.addEventListener(c,b.adEventHandler.bind(b))})},b.prototype.stopRoutingAdEvents=function(){var a=this._adPlaybackStrategy.getAdPlayer();if(this._player!==a){var b=this;this._eventsToRoute.forEach(function(c){a.removeEventListener(c,b.adEventHandler.bind(b))})}},b.prototype.adEventHandler=function(a){if(this._adPlaybackStrategy.isPlayingAd()){var b,c=this._adPlaybackStrategy.getAdPlayer();switch(a.type){case amp.eventName.error:if(!this._adPlaybackStrategy.isPlayingAd())return;b=amp.eventName.errorInPlayingAd,this._adPlaybackStrategy.updateAutoPlay(!0);break;case amp.eventName.ended:b=amp.eventName.complete;break;case amp.eventName.pause:if(b=amp.eventName.pause,c.ended())return;break;case amp.eventName.click:if(b=amp.eventName.click,c.paused())return void c.play();c.pause(),this.stopAdPlayTimer();break;default:b=a.type}this._player.trigger(b,null,c.currentClip(),c.currentTime()),(b===amp.eventName.errorInPlayingAd||b===amp.eventName.skip)&&this.handleEnded(c)}},b.prototype.resumeMainContent=function(a){this.stopAdPlayTimer(),(this.isTimeToResumeMainContent()||a)&&(this._currentPreloadPlayIndexInMidRolls=-1,this._adPlaybackStrategy.resumeMainContent(),this._adPlayStartTime=0/0,this.removeObsoleteMidRollsForLiveStreaming())},b.prototype.handleFirstPlay=function(a){this._adPlaybackStrategy.isPlayingAd()||(this._mainContentLive=a.isLive(),this._mainContentLive&&(this.removeStaticMidRolls(),this._player.trigger("midrollAdded"),this._currentPreloadPlayIndexInMidRolls=-1))},b.prototype.removeStaticMidRolls=function(){var a=[];if(this._midRolls.length>0){for(var b=0;b0&&a.push(this._midRolls[b]);this._midRolls=a}},b.prototype.playerSeeked=function(){var a=this;if(!this._adPlaybackStrategy.isPlayingAd()&&this._midRolls.length>0){var b=this._player.currentMediaTime();this.handleSkipAndPlayPreloadedAd(b)||(this._lastMidRollPlayed=null,this._lastMainContentTime=b,AzureHtml5JS.Util.setTimeout(function(){a.preloadAd(a._lastMainContentTime,!0)},100))}},b.prototype.handleSkipAndPlayPreloadedAd=function(a){if(this._lastMainContentTimethis._midRolls[this._currentPreloadPlayIndexInMidRolls].splice.startOffset){{var b=this._adPlaybackStrategy.getAdPlayer();b.bufferedPercent()}return this.handleTimeUpdateAndFetchMidRoll(this._midRolls[this._currentPreloadPlayIndexInMidRolls].splice.startOffset,!1,!0)}return!1},b.prototype.playerTimeUpdate=function(a){!this._adPlaybackStrategy.isPlayingAd()&&this._midRolls.length>0&&!a.paused()&&(this._lastMainContentTime=this._player.currentMediaTime(),this.handleTimeUpdateAndFetchMidRoll(this._lastMainContentTime)||this.checkIfPreloadNeedsRefresh()&&this.preloadAd(this._lastMainContentTime,!1))},b.prototype.checkIfPreloadNeedsRefresh=function(){return!this._adPlaybackStrategy.isPlayingAd()&&-1!==this._currentPreloadPlayIndexInMidRolls&&this._player.currentMediaTime()0&&this._midRolls[this._midRolls.length-1].splice.startOffset<=a.splice.startOffset?!1:0===this._midRolls.length?!1:!0},b.prototype.removeObsoleteMidRollsForLiveStreaming=function(){if(this._mainContentLive&&!this._adPlaybackStrategy.isPlayingAd()){var b=this._player.currentMediaTime()-this._player.currentTime();if(this._midRolls.length>0){for(var c=[],d=[],e=0;e0&&this._midRolls[e].splice.startOffset0&&(this._midRolls=c,this._currentClipIndexInPlayList=-1)}}},b.prototype.updateExistingMidRoll=function(b){if(b.splice.id>0)for(var c=this._midRolls.length,d=0;c>d;d++)if(this._midRolls[d].splice.id===b.splice.id){a.Logger.verbose(9,"Duplicate splice with ID ="+this._midRolls[d].splice.id+" storing a suplimentory Clip new duration ="+b.splice.duration+" new startOffset="+b.splice.startOffset);var e=this._midRolls[d].splice;if(this._currentPreloadPlayIndexInMidRolls===d&&this._adPlaybackStrategy.isPlayingAd()){if(e.startOffset===b.splice.startOffset){if(e.duration>b.splice.duration){e.duration=b.splice.duration;var f=(Date.now()-this._adPlayStartTime)/1e3;this.startAdPlayMonitor(this._midRolls[d],e.startOffset+f)}return this._midRolls[d]=b,!0}this._lastMidRollPlayed=null,this.resumeMainContent(!0)}return this._midRolls.splice(d,1),!1}},b.prototype.getMidRolls=function(){return this._midRolls},b.prototype.keepMidRollsSorted=function(){this._midRolls.length>1&&this._midRolls.sort(function(a,b){return a.splice.startOffset-b.splice.startOffset})},b.prototype.clearSplice=function(b){var c=this;if(this._currentPreloadPlayIndexInMidRolls>=0&&this._adPlaybackStrategy.isPlayingAd()&&this._midRolls[this._currentPreloadPlayIndexInMidRolls].splice&&this._midRolls[this._currentPreloadPlayIndexInMidRolls].splice.id===b.id){var d=this._midRolls[this._currentPreloadPlayIndexInMidRolls];if(void 0!==b.cancel&&b.cancel)this.resumeMainContent(!0);else if(void 0!==b.out&&!b.out&&void 0===d.splice.duration){var e=b.startOffset,f=(this._lastMainContentTime,(Date.now()-this._adPlayStartTime)/1e3),g=e-d.splice.startOffset,h=g-f;d.splice.duration=g,a.Logger.verbose(9,"Updated duration of splice with Id = "+d.splice.id+" to = "+d.splice.duration),0>=h?this.resumeMainContent(!0):(this.stopAdPlayTimer(),this._adPlayMonitorTimerId=AzureHtml5JS.Util.setTimeout(function(){c.resumeMainContent()},1e3*h))}}else if(void 0!==b.out&&void 0===b.cancel&&!b.out){var i=this.searchMidRollsForSplice(b);if(-1!==i){var j=this._midRolls[i],e=b.startOffset,g=e-j.splice.startOffset;j.splice.duration=g}}if(b.cancel){var k=-1;for(k=this.searchMidRollsForSplice(b);-1!==k;)this._midRolls.splice(k,1),k=this.searchMidRollsForSplice(b);this._currentPreloadPlayIndexInMidRolls=-1}},b.prototype.searchMidRollsForSplice=function(a){for(var b=0;ba&&this._midRolls[c].splice.startOffset0&&a>b.splice.startOffset+b.splice.duration?c=1:void 0===b.splice.duration&&a>b.splice.startOffset+e&&(c=1),c},b.prototype.handleTimeUpdateAndFetchMidRoll=function(c,d,e){if(!this._adPlaybackStrategy.isPlayingAd()||d){var f=b.binarySearchThroughMidRolls(c,this._midRolls,this.compareAdStartTimeForPlay);if(-1!==f&&this._midRolls[f].clip&&(!e||this._midRolls[f].played!==!0)&&this._lastMidRollPlayed!==this._midRolls[f]){a.Logger.verbose(9,"Found an Ad that we can play for media time = "+c);var g=this._adPlayStartTime;return this.startMidRollPlayback(this._midRolls[f],c),d&&!isNaN(g)&&(this._adPlayStartTime=g),this._currentPreloadPlayIndexInMidRolls=f,!0}}return!1},b.prototype.startMidRollPlayback=function(b,c){this._adPlaybackStrategy.updateAutoPlay(!0),this._lastMidRollPlayed=b,this.startAdPlayMonitor(b,c),this._adPlayStartTime=Date.now(),this._mainContentAtLiveEdgeBeforeAdBreak=this._adPlaybackStrategy.isMainContentAtLiveEdge(),this._mainContentLive=this._adPlaybackStrategy.isMainContentLive(),a.Logger.verbose(9,"Starting Ad playback for time ="+c+" ad start time = "+b.splice.startOffset+" ad duration = "+b.splice.cancel),this._adPlaybackStrategy.playAdClip(b.clip,b.splice.id>0),b.played=!0},b.prototype.preloadAd=function(b,c){if(null!==this._adPlaybackStrategy.currentClip()&&!this._adPlaybackStrategy.currentClip().isAd){var d=this.searchMidRollsAfterTimeForPreload(b);if(-1!==d&&this._midRolls[d].clip&&this._currentPreloadPlayIndexInMidRolls!==d&&this._lastMidRollPlayed!==this._midRolls[d]){var e=!1;c?e=!0:-1===this._currentPreloadPlayIndexInMidRolls&&(e=!0),e&&this._midRolls[d].clip&&(a.Logger.verbose(9,"Preloading ad CLip with src ="+this._midRolls[d].clip.parent.source.src),this._adPlaybackStrategy.preloadAd(this._midRolls[d].clip),this._nextClipPreloaded=!0,this._currentPreloadPlayIndexInMidRolls=d)}else this._mainContentLive||(this._currentClipIndexInPlayListc&&(this._mainPlayer.el_.style.opacity=0,this.pauseMainContent(),AzureHtml5JS.Util.setTimeout(function(){b._mainPlayer.el_.style.opacity=1,b._mainPlayer.play()},200))}catch(d){a.Logger.warning(9,"Exception in startMainContentPlay.")}},c.prototype.handlePostRollCompleted=function(){this.copyPlayerStatus(this._adPlayer,this._mainPlayer),null!=this._adPlayer&&this._adPlayer.pauseAndHide(),this.updateMainContentPlaybackRate(),this._currentPlayer=this._mainPlayer,this._mainPlayer.show()},c.prototype.copyPlayerStatus=function(b,c){try{null!==b&&null!==c&&(c.volume(b.volume()),c.muted(b.muted())); }catch(d){a.Logger.warning(9,"Exception in copying volume status.")}},c.prototype.setUpFullScreenEventHandling=function(){var b=this;try{this._mainPlayer.addEventListener("fullscreenchange",function(){b.copyFullScreenStatus(b._mainPlayer,b._adPlayer)}),this._adPlayer.addEventListener("fullscreenchange",function(){b.copyFullScreenStatus(b._adPlayer,b._mainPlayer)})}catch(c){a.Logger.warning(9,"Exception in settingup fullscreen event handling.")}},c.prototype.copyFullScreenStatus=function(b,c){try{b.isFullscreen()&&!c.isFullscreen()?c.enterFullscreen():!b.isFullscreen()&&c.isFullscreen()&&c.exitFullscreen()}catch(d){a.Logger.warning(9,"Exception in copying fullscreen status.")}},c.prototype.pauseMainContent=function(){try{null!==this._mainPlayer&&this._mainPlayer.pause()}catch(b){a.Logger.warning(9,"Exception in pausing playback.")}},c.prototype.getAdPlayer=function(){return this._adPlayer},c.prototype.currentClip=function(){return this._currentPlayer.currentClip()},c.prototype.populateAdDomElements=function(){this._adPlayer=this._mainPlayer.createAdPlayer()},c}(d);b.MultiPlayerStrategy=e}(b.Strategy||(b.Strategy={}));b.Strategy}(a.Scheduler||(a.Scheduler={}));a.Scheduler}(AMP||(AMP={})),function(a){var b=a.vttjs={},c=b.VTTCue,d=b.VTTRegion,e=a.VTTCue,f=a.VTTRegion;b.shim=function(){b.VTTCue=c,b.VTTRegion=d},b.restore=function(){b.VTTCue=e,b.VTTRegion=f}}(this),function(a,b){function c(a){if("string"!=typeof a)return!1;var b=h[a.toLowerCase()];return b?a.toLowerCase():!1}function d(a){if("string"!=typeof a)return!1;var b=i[a.toLowerCase()];return b?a.toLowerCase():!1}function e(a){for(var b=1;ba||a>100)throw new Error("Position must be between 0 and 100.");u=a,this.hasBeenReset=!0}})),Object.defineProperty(h,"positionAlign",e({},j,{get:function(){return v},set:function(a){var b=d(a);if(!b)throw new SyntaxError("An invalid or illegal string was specified.");v=b,this.hasBeenReset=!0}})),Object.defineProperty(h,"size",e({},j,{get:function(){return w},set:function(a){if(0>a||a>100)throw new Error("Size must be between 0 and 100.");w=a,this.hasBeenReset=!0}})),Object.defineProperty(h,"align",e({},j,{get:function(){return x},set:function(a){var b=d(a);if(!b)throw new SyntaxError("An invalid or illegal string was specified.");x=b,this.hasBeenReset=!0}})),h.displayState=void 0,i?h:void 0}var g="auto",h={"":!0,lr:!0,rl:!0},i={start:!0,middle:!0,end:!0,left:!0,right:!0};f.prototype.getCueAsHTML=function(){return WebVTT.convertCueToDOMTree(window,this.text)},a.VTTCue=a.VTTCue||f,b.VTTCue=f}(this,this.vttjs||{}),function(a,b){function c(a){if("string"!=typeof a)return!1;var b=f[a.toLowerCase()];return b?a.toLowerCase():!1}function d(a){return"number"==typeof a&&a>=0&&100>=a}function e(){var a=100,b=3,e=0,f=100,g=0,h=100,i="";Object.defineProperties(this,{width:{enumerable:!0,get:function(){return a},set:function(b){if(!d(b))throw new Error("Width must be between 0 and 100.");a=b}},lines:{enumerable:!0,get:function(){return b},set:function(a){if("number"!=typeof a)throw new TypeError("Lines must be set to a number.");b=a}},regionAnchorY:{enumerable:!0,get:function(){return f},set:function(a){if(!d(a))throw new Error("RegionAnchorX must be between 0 and 100.");f=a}},regionAnchorX:{enumerable:!0,get:function(){return e},set:function(a){if(!d(a))throw new Error("RegionAnchorY must be between 0 and 100.");e=a}},viewportAnchorY:{enumerable:!0,get:function(){return h},set:function(a){if(!d(a))throw new Error("ViewportAnchorY must be between 0 and 100.");h=a}},viewportAnchorX:{enumerable:!0,get:function(){return g},set:function(a){if(!d(a))throw new Error("ViewportAnchorX must be between 0 and 100.");g=a}},scroll:{enumerable:!0,get:function(){return i},set:function(a){var b=c(a);if(b===!1)throw new SyntaxError("An invalid or illegal string was specified.");i=b}}})}var f={"":!0,up:!0};a.VTTRegion=a.VTTRegion||e,b.VTTRegion=e}(this,this.vttjs||{}),function(a){function b(a,b){this.name="ParsingError",this.code=a.code,this.message=b||a.message}function c(a){function b(a,b,c,d){return 3600*(0|a)+60*(0|b)+(0|c)+(0|d)/1e3}var c=a.match(/^(\d+):(\d{2})(:\d{2})?\.(\d{3})/);return c?c[3]?b(c[1],c[2],c[3].replace(":",""),c[4]):c[1]>59?b(c[1],c[2],0,c[4]):b(0,c[1],c[2],c[4]):null}function d(){this.values=o(null)}function e(a,b,c,d){var e=d?a.split(d):[a];for(var f in e)if("string"==typeof e[f]){var g=e[f].split(c);if(2===g.length){var h=g[0],i=g[1];b(h,i)}}}function f(a,f,g){function h(){var d=c(a);if(null===d)throw new b(b.Errors.BadTimeStamp,"Malformed timestamp: "+k);return a=a.replace(/^[^\sa-zA-Z-]+/,""),d}function i(a,b){var c=new d;e(a,function(a,b){switch(a){case"region":for(var d=g.length-1;d>=0;d--)if(g[d].id===b){c.set(a,g[d].region);break}break;case"vertical":c.alt(a,b,["rl","lr"]);break;case"line":var e=b.split(","),f=e[0];c.integer(a,f),c.percent(a,f)?c.set("snapToLines",!1):null,c.alt(a,f,["auto"]),2===e.length&&c.alt("lineAlign",e[1],["start","middle","end"]);break;case"position":e=b.split(","),c.percent(a,e[0]),2===e.length&&c.alt("positionAlign",e[1],["start","middle","end"]);break;case"size":c.percent(a,b);break;case"align":c.alt(a,b,["start","middle","end","left","right"])}},/:/,/\s/),b.region=c.get("region",null),b.vertical=c.get("vertical",""),b.line=c.get("line","auto"),b.lineAlign=c.get("lineAlign","start"),b.snapToLines=c.get("snapToLines",!0),b.size=c.get("size",100),b.align=c.get("align","middle"),b.position=c.get("position",{start:0,left:0,middle:50,end:100,right:100},b.align),b.positionAlign=c.get("positionAlign",{start:"start",left:"start",middle:"middle",end:"end",right:"end"},b.align)}function j(){a=a.replace(/^\s+/,"")}var k=a;if(j(),f.startTime=h(),j(),"-->"!==a.substr(0,3))throw new b(b.Errors.BadTimeStamp,"Malformed time stamp (time stamps must be separated by '-->'): "+k);a=a.substr(3),j(),f.endTime=h(),j(),i(a,f)}function g(a,b){function d(){function a(a){return b=b.substr(a.length),a}if(!b)return null;var c=b.match(/^([^<]*)(<[^>]+>?)?/);return a(c[1]?c[1]:c[2])}function e(a){return p[a]}function f(a){for(;o=a.match(/&(amp|lt|gt|lrm|rlm|nbsp);/);)a=a.replace(o[0],e);return a}function g(a,b){return!s[b.localName]||s[b.localName]===a.localName}function h(b,c){var d=q[b];if(!d)return null;var e=a.document.createElement(d);e.localName=d;var f=r[b];return f&&c&&(e[f]=c.trim()),e}for(var i,j=a.document.createElement("div"),k=j,l=[];null!==(i=d());)if("<"!==i[0])k.appendChild(a.document.createTextNode(f(i)));else{if("/"===i[1]){l.length&&l[l.length-1]===i.substr(2).replace(">","")&&(l.pop(),k=k.parentNode);continue}var m,n=c(i.substr(1,i.length-2));if(n){m=a.document.createProcessingInstruction("timestamp",n),k.appendChild(m);continue}var o=i.match(/^<([^.\s\/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/);if(!o)continue;if(m=h(o[1],o[3]),!m)continue;if(!g(k,m))continue;o[2]&&(m.className=o[2].substr(1).replace("."," ")),l.push(o[1]),k.appendChild(m),k=m}return j}function h(a){function b(a,b){for(var c=b.childNodes.length-1;c>=0;c--)a.push(b.childNodes[c])}function c(a){if(!a||!a.length)return null;var d=a.pop(),e=d.textContent||d.innerText;if(e){var f=e.match(/^.*(\n|\r)/);return f?(a.length=0,f[0]):e}return"ruby"===d.tagName?c(a):d.childNodes?(b(a,d),c(a)):void 0}var d,e=[],f="";if(!a||!a.childNodes)return"ltr";for(b(e,a);f=c(e);)for(var g=0;g=0&&a.line<=100))return a.line;if(!a.track||!a.track.textTrackList||!a.track.textTrackList.mediaElement)return-1;for(var b=a.track,c=b.textTrackList,d=0,e=0;ei&&(e=new l(a),g=i),a=new l(f)}return e||f}var f=new l(b),g=b.cue,h=i(g),j=[];if(g.snapToLines){var k;switch(g.vertical){case"":j=["+y","-y"],k="height";break;case"rl":j=["+x","-x"],k="width";break;case"lr":j=["-x","+x"],k="width"}var m=f.lineHeight,n=m*Math.round(h),o=c[k]+m,p=j[0];Math.abs(n)>o&&(n=0>n?-1:1,n*=Math.ceil(o/m)*m),0>h&&(n+=""===g.vertical?c.height:c.width,j=j.reverse()),f.move(p,n)}else{var q=f.lineHeight/c.height*100;switch(g.lineAlign){case"middle":h-=q/2;break;case"end":h-=q}switch(g.vertical){case"":b.applyStyles({top:b.formatStyle(h,"%")});break;case"rl":b.applyStyles({left:b.formatStyle(h,"%")});break;case"lr":b.applyStyles({right:b.formatStyle(h,"%")})}j=["+y","-x","+x","-y"],f=new l(b)}var r=e(f,j);b.move(r.toCSSCompatValues(c))}function n(){}var o=Object.create||function(){function a(){}return function(b){if(1!==arguments.length)throw new Error("Object.create shim only accepts one parameter.");return a.prototype=b,new a}}();b.prototype=o(Error.prototype),b.prototype.constructor=b,b.Errors={BadSignature:{code:0,message:"Malformed WebVTT signature."},BadTimeStamp:{code:1,message:"Malformed time stamp."}},d.prototype={set:function(a,b){this.get(a)||""===b||(this.values[a]=b)},get:function(a,b,c){return c?this.has(a)?this.values[a]:b[c]:this.has(a)?this.values[a]:b},has:function(a){return a in this.values},alt:function(a,b,c){for(var d=0;d=0&&100>=b)?(this.set(a,b),!0):!1}};var p={"&":"&","<":"<",">":">","‎":"‎","‏":"‏"," ":" "},q={c:"span",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"span",lang:"span"},r={v:"title",lang:"lang"},s={rt:"ruby"},t=[1470,1472,1475,1478,1488,1489,1490,1491,1492,1493,1494,1495,1496,1497,1498,1499,1500,1501,1502,1503,1504,1505,1506,1507,1508,1509,1510,1511,1512,1513,1514,1520,1521,1522,1523,1524,1544,1547,1549,1563,1566,1567,1568,1569,1570,1571,1572,1573,1574,1575,1576,1577,1578,1579,1580,1581,1582,1583,1584,1585,1586,1587,1588,1589,1590,1591,1592,1593,1594,1595,1596,1597,1598,1599,1600,1601,1602,1603,1604,1605,1606,1607,1608,1609,1610,1645,1646,1647,1649,1650,1651,1652,1653,1654,1655,1656,1657,1658,1659,1660,1661,1662,1663,1664,1665,1666,1667,1668,1669,1670,1671,1672,1673,1674,1675,1676,1677,1678,1679,1680,1681,1682,1683,1684,1685,1686,1687,1688,1689,1690,1691,1692,1693,1694,1695,1696,1697,1698,1699,1700,1701,1702,1703,1704,1705,1706,1707,1708,1709,1710,1711,1712,1713,1714,1715,1716,1717,1718,1719,1720,1721,1722,1723,1724,1725,1726,1727,1728,1729,1730,1731,1732,1733,1734,1735,1736,1737,1738,1739,1740,1741,1742,1743,1744,1745,1746,1747,1748,1749,1765,1766,1774,1775,1786,1787,1788,1789,1790,1791,1792,1793,1794,1795,1796,1797,1798,1799,1800,1801,1802,1803,1804,1805,1807,1808,1810,1811,1812,1813,1814,1815,1816,1817,1818,1819,1820,1821,1822,1823,1824,1825,1826,1827,1828,1829,1830,1831,1832,1833,1834,1835,1836,1837,1838,1839,1869,1870,1871,1872,1873,1874,1875,1876,1877,1878,1879,1880,1881,1882,1883,1884,1885,1886,1887,1888,1889,1890,1891,1892,1893,1894,1895,1896,1897,1898,1899,1900,1901,1902,1903,1904,1905,1906,1907,1908,1909,1910,1911,1912,1913,1914,1915,1916,1917,1918,1919,1920,1921,1922,1923,1924,1925,1926,1927,1928,1929,1930,1931,1932,1933,1934,1935,1936,1937,1938,1939,1940,1941,1942,1943,1944,1945,1946,1947,1948,1949,1950,1951,1952,1953,1954,1955,1956,1957,1969,1984,1985,1986,1987,1988,1989,1990,1991,1992,1993,1994,1995,1996,1997,1998,1999,2e3,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017,2018,2019,2020,2021,2022,2023,2024,2025,2026,2036,2037,2042,2048,2049,2050,2051,2052,2053,2054,2055,2056,2057,2058,2059,2060,2061,2062,2063,2064,2065,2066,2067,2068,2069,2074,2084,2088,2096,2097,2098,2099,2100,2101,2102,2103,2104,2105,2106,2107,2108,2109,2110,2112,2113,2114,2115,2116,2117,2118,2119,2120,2121,2122,2123,2124,2125,2126,2127,2128,2129,2130,2131,2132,2133,2134,2135,2136,2142,2208,2210,2211,2212,2213,2214,2215,2216,2217,2218,2219,2220,8207,64285,64287,64288,64289,64290,64291,64292,64293,64294,64295,64296,64298,64299,64300,64301,64302,64303,64304,64305,64306,64307,64308,64309,64310,64312,64313,64314,64315,64316,64318,64320,64321,64323,64324,64326,64327,64328,64329,64330,64331,64332,64333,64334,64335,64336,64337,64338,64339,64340,64341,64342,64343,64344,64345,64346,64347,64348,64349,64350,64351,64352,64353,64354,64355,64356,64357,64358,64359,64360,64361,64362,64363,64364,64365,64366,64367,64368,64369,64370,64371,64372,64373,64374,64375,64376,64377,64378,64379,64380,64381,64382,64383,64384,64385,64386,64387,64388,64389,64390,64391,64392,64393,64394,64395,64396,64397,64398,64399,64400,64401,64402,64403,64404,64405,64406,64407,64408,64409,64410,64411,64412,64413,64414,64415,64416,64417,64418,64419,64420,64421,64422,64423,64424,64425,64426,64427,64428,64429,64430,64431,64432,64433,64434,64435,64436,64437,64438,64439,64440,64441,64442,64443,64444,64445,64446,64447,64448,64449,64467,64468,64469,64470,64471,64472,64473,64474,64475,64476,64477,64478,64479,64480,64481,64482,64483,64484,64485,64486,64487,64488,64489,64490,64491,64492,64493,64494,64495,64496,64497,64498,64499,64500,64501,64502,64503,64504,64505,64506,64507,64508,64509,64510,64511,64512,64513,64514,64515,64516,64517,64518,64519,64520,64521,64522,64523,64524,64525,64526,64527,64528,64529,64530,64531,64532,64533,64534,64535,64536,64537,64538,64539,64540,64541,64542,64543,64544,64545,64546,64547,64548,64549,64550,64551,64552,64553,64554,64555,64556,64557,64558,64559,64560,64561,64562,64563,64564,64565,64566,64567,64568,64569,64570,64571,64572,64573,64574,64575,64576,64577,64578,64579,64580,64581,64582,64583,64584,64585,64586,64587,64588,64589,64590,64591,64592,64593,64594,64595,64596,64597,64598,64599,64600,64601,64602,64603,64604,64605,64606,64607,64608,64609,64610,64611,64612,64613,64614,64615,64616,64617,64618,64619,64620,64621,64622,64623,64624,64625,64626,64627,64628,64629,64630,64631,64632,64633,64634,64635,64636,64637,64638,64639,64640,64641,64642,64643,64644,64645,64646,64647,64648,64649,64650,64651,64652,64653,64654,64655,64656,64657,64658,64659,64660,64661,64662,64663,64664,64665,64666,64667,64668,64669,64670,64671,64672,64673,64674,64675,64676,64677,64678,64679,64680,64681,64682,64683,64684,64685,64686,64687,64688,64689,64690,64691,64692,64693,64694,64695,64696,64697,64698,64699,64700,64701,64702,64703,64704,64705,64706,64707,64708,64709,64710,64711,64712,64713,64714,64715,64716,64717,64718,64719,64720,64721,64722,64723,64724,64725,64726,64727,64728,64729,64730,64731,64732,64733,64734,64735,64736,64737,64738,64739,64740,64741,64742,64743,64744,64745,64746,64747,64748,64749,64750,64751,64752,64753,64754,64755,64756,64757,64758,64759,64760,64761,64762,64763,64764,64765,64766,64767,64768,64769,64770,64771,64772,64773,64774,64775,64776,64777,64778,64779,64780,64781,64782,64783,64784,64785,64786,64787,64788,64789,64790,64791,64792,64793,64794,64795,64796,64797,64798,64799,64800,64801,64802,64803,64804,64805,64806,64807,64808,64809,64810,64811,64812,64813,64814,64815,64816,64817,64818,64819,64820,64821,64822,64823,64824,64825,64826,64827,64828,64829,64848,64849,64850,64851,64852,64853,64854,64855,64856,64857,64858,64859,64860,64861,64862,64863,64864,64865,64866,64867,64868,64869,64870,64871,64872,64873,64874,64875,64876,64877,64878,64879,64880,64881,64882,64883,64884,64885,64886,64887,64888,64889,64890,64891,64892,64893,64894,64895,64896,64897,64898,64899,64900,64901,64902,64903,64904,64905,64906,64907,64908,64909,64910,64911,64914,64915,64916,64917,64918,64919,64920,64921,64922,64923,64924,64925,64926,64927,64928,64929,64930,64931,64932,64933,64934,64935,64936,64937,64938,64939,64940,64941,64942,64943,64944,64945,64946,64947,64948,64949,64950,64951,64952,64953,64954,64955,64956,64957,64958,64959,64960,64961,64962,64963,64964,64965,64966,64967,65008,65009,65010,65011,65012,65013,65014,65015,65016,65017,65018,65019,65020,65136,65137,65138,65139,65140,65142,65143,65144,65145,65146,65147,65148,65149,65150,65151,65152,65153,65154,65155,65156,65157,65158,65159,65160,65161,65162,65163,65164,65165,65166,65167,65168,65169,65170,65171,65172,65173,65174,65175,65176,65177,65178,65179,65180,65181,65182,65183,65184,65185,65186,65187,65188,65189,65190,65191,65192,65193,65194,65195,65196,65197,65198,65199,65200,65201,65202,65203,65204,65205,65206,65207,65208,65209,65210,65211,65212,65213,65214,65215,65216,65217,65218,65219,65220,65221,65222,65223,65224,65225,65226,65227,65228,65229,65230,65231,65232,65233,65234,65235,65236,65237,65238,65239,65240,65241,65242,65243,65244,65245,65246,65247,65248,65249,65250,65251,65252,65253,65254,65255,65256,65257,65258,65259,65260,65261,65262,65263,65264,65265,65266,65267,65268,65269,65270,65271,65272,65273,65274,65275,65276,67584,67585,67586,67587,67588,67589,67592,67594,67595,67596,67597,67598,67599,67600,67601,67602,67603,67604,67605,67606,67607,67608,67609,67610,67611,67612,67613,67614,67615,67616,67617,67618,67619,67620,67621,67622,67623,67624,67625,67626,67627,67628,67629,67630,67631,67632,67633,67634,67635,67636,67637,67639,67640,67644,67647,67648,67649,67650,67651,67652,67653,67654,67655,67656,67657,67658,67659,67660,67661,67662,67663,67664,67665,67666,67667,67668,67669,67671,67672,67673,67674,67675,67676,67677,67678,67679,67840,67841,67842,67843,67844,67845,67846,67847,67848,67849,67850,67851,67852,67853,67854,67855,67856,67857,67858,67859,67860,67861,67862,67863,67864,67865,67866,67867,67872,67873,67874,67875,67876,67877,67878,67879,67880,67881,67882,67883,67884,67885,67886,67887,67888,67889,67890,67891,67892,67893,67894,67895,67896,67897,67903,67968,67969,67970,67971,67972,67973,67974,67975,67976,67977,67978,67979,67980,67981,67982,67983,67984,67985,67986,67987,67988,67989,67990,67991,67992,67993,67994,67995,67996,67997,67998,67999,68e3,68001,68002,68003,68004,68005,68006,68007,68008,68009,68010,68011,68012,68013,68014,68015,68016,68017,68018,68019,68020,68021,68022,68023,68030,68031,68096,68112,68113,68114,68115,68117,68118,68119,68121,68122,68123,68124,68125,68126,68127,68128,68129,68130,68131,68132,68133,68134,68135,68136,68137,68138,68139,68140,68141,68142,68143,68144,68145,68146,68147,68160,68161,68162,68163,68164,68165,68166,68167,68176,68177,68178,68179,68180,68181,68182,68183,68184,68192,68193,68194,68195,68196,68197,68198,68199,68200,68201,68202,68203,68204,68205,68206,68207,68208,68209,68210,68211,68212,68213,68214,68215,68216,68217,68218,68219,68220,68221,68222,68223,68352,68353,68354,68355,68356,68357,68358,68359,68360,68361,68362,68363,68364,68365,68366,68367,68368,68369,68370,68371,68372,68373,68374,68375,68376,68377,68378,68379,68380,68381,68382,68383,68384,68385,68386,68387,68388,68389,68390,68391,68392,68393,68394,68395,68396,68397,68398,68399,68400,68401,68402,68403,68404,68405,68416,68417,68418,68419,68420,68421,68422,68423,68424,68425,68426,68427,68428,68429,68430,68431,68432,68433,68434,68435,68436,68437,68440,68441,68442,68443,68444,68445,68446,68447,68448,68449,68450,68451,68452,68453,68454,68455,68456,68457,68458,68459,68460,68461,68462,68463,68464,68465,68466,68472,68473,68474,68475,68476,68477,68478,68479,68608,68609,68610,68611,68612,68613,68614,68615,68616,68617,68618,68619,68620,68621,68622,68623,68624,68625,68626,68627,68628,68629,68630,68631,68632,68633,68634,68635,68636,68637,68638,68639,68640,68641,68642,68643,68644,68645,68646,68647,68648,68649,68650,68651,68652,68653,68654,68655,68656,68657,68658,68659,68660,68661,68662,68663,68664,68665,68666,68667,68668,68669,68670,68671,68672,68673,68674,68675,68676,68677,68678,68679,68680,126464,126465,126466,126467,126469,126470,126471,126472,126473,126474,126475,126476,126477,126478,126479,126480,126481,126482,126483,126484,126485,126486,126487,126488,126489,126490,126491,126492,126493,126494,126495,126497,126498,126500,126503,126505,126506,126507,126508,126509,126510,126511,126512,126513,126514,126516,126517,126518,126519,126521,126523,126530,126535,126537,126539,126541,126542,126543,126545,126546,126548,126551,126553,126555,126557,126559,126561,126562,126564,126567,126568,126569,126570,126572,126573,126574,126575,126576,126577,126578,126580,126581,126582,126583,126585,126586,126587,126588,126590,126592,126593,126594,126595,126596,126597,126598,126599,126600,126601,126603,126604,126605,126606,126607,126608,126609,126610,126611,126612,126613,126614,126615,126616,126617,126618,126619,126625,126626,126627,126629,126630,126631,126632,126633,126635,126636,126637,126638,126639,126640,126641,126642,126643,126644,126645,126646,126647,126648,126649,126650,126651,1114109];j.prototype.applyStyles=function(a,b){b=b||this.div;for(var c in a)a.hasOwnProperty(c)&&(b.style[c]=a[c])},j.prototype.formatStyle=function(a,b){return 0===a?0:a+b},k.prototype=o(j.prototype),k.prototype.constructor=k,l.prototype.move=function(a,b){switch(b=void 0!==b?b:this.lineHeight,a){case"+x":this.left+=b,this.right+=b;break;case"-x":this.left-=b,this.right-=b;break;case"+y":this.top+=b,this.bottom+=b;break;case"-y":this.top-=b,this.bottom-=b}},l.prototype.overlaps=function(a){return this.lefta.left&&this.topa.top},l.prototype.overlapsAny=function(a){for(var b=0;b=a.top&&this.bottom<=a.bottom&&this.left>=a.left&&this.right<=a.right},l.prototype.overlapsOppositeAxis=function(a,b){switch(b){case"+x":return this.lefta.right;case"+y":return this.topa.bottom}},l.prototype.intersectPercentage=function(a){var b=Math.max(0,Math.min(this.right,a.right)-Math.max(this.left,a.left)),c=Math.max(0,Math.min(this.bottom,a.bottom)-Math.max(this.top,a.top)),d=b*c;return d/(this.height*this.width)},l.prototype.toCSSCompatValues=function(a){return{top:this.top-a.top,bottom:a.bottom-this.bottom,left:this.left-a.left,right:a.right-this.right,height:this.height,width:this.width}},l.getSimpleBoxPosition=function(a){var b=a.div?a.div.offsetHeight:a.tagName?a.offsetHeight:0,c=a.div?a.div.offsetWidth:a.tagName?a.offsetWidth:0,d=a.div?a.div.offsetTop:a.tagName?a.offsetTop:0;a=a.div?a.div.getBoundingClientRect():a.tagName?a.getBoundingClientRect():a;var e={left:a.left,right:a.right,top:a.top||d,height:a.height||b,bottom:a.bottom||d+(a.height||b),width:a.width||c};return e},n.StringDecoder=function(){return{decode:function(a){if(!a)return"";if("string"!=typeof a)throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(a))}}},n.convertCueToDOMTree=function(a,b){return a&&b?g(a,b):null};var u=.05,v="sans-serif",w="1.5%";n.processCues=function(a,b,c){function d(a){for(var b=0;b")){i.cue.id=j;continue}case"CUE":try{f(j,i.cue,i.regionList)}catch(m){i.reportOrThrowError(m),i.cue=null,i.state="BADCUE";continue}i.state="CUETEXT";continue;case"CUETEXT":var n=-1!==j.indexOf("-->");if(!j||n&&(l=!0)){i.oncue&&i.oncue(i.cue),i.cue=null,i.state="ID";continue}i.cue.text&&(i.cue.text+="\n"),i.cue.text+=j;continue;case"BADCUE":j||(i.state="ID");continue}}}catch(m){i.reportOrThrowError(m),"CUETEXT"===i.state&&i.cue&&i.oncue&&i.oncue(i.cue),i.cue=null,i.state="INITIAL"===i.state?"BADWEBVTT":"BADCUE"}return this},flush:function(){var a=this;try{if(a.buffer+=a.decoder.decode(),(a.cue||"HEADER"===a.state)&&(a.buffer+="\n\n",a.parse()),"INITIAL"===a.state)throw new b(b.Errors.BadSignature)}catch(c){a.reportOrThrowError(c)}return a.onflush&&a.onflush(),this}},a.WebVTT=n}(this,this.vttjs||{}); //# sourceMappingURL=azuremediaplayer.min.js.map /* End of azuremediaplayer.min.js */